question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error using rez on windows

See original GitHub issue

I’m trying to build the hello_world example package provided with rez but I’m getting errors just doing the cmake compiler tests that I don’t get when just running cmake by itself without rez.

When I run rez-build on the hello_world project, I get the following output:

NOTE: I get this same output even if the CMakeLists.txt file only contains the cmake_minimum_required command

Executing: c:\program files (x86)\cmake\bin\cmake.exe -d C:\Users\babel\workspace\rez\example_packages\hello_world -Wno-dev -DCMAKE_ECLIPSE_GENERATE_S
OURCE_PROJECT=TRUE -D_ECLIPSE_VERSION=4.3 --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX=C:\Users\babel\packages\hello_world\1.0.0 -DCMAKE_MODULE_PATH=%C
MAKE_MODULE_PATH% -DCMAKE_BUILD_TYPE=Release -DREZ_BUILD_TYPE=local -DREZ_BUILD_INSTALL=0 -G NMake Makefiles
Not searching for unused variables given on the command line.
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.6/Modules/CMakeTestCCompiler.cmake:61 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  14.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/Users/babel/workspace/rez/example_packages/hello_world/build/CMakeFiles/CMakeTmp



  Run Build Command:"nmake" "/NOLOGO" "cmTC_62b41\fast"

        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\nmake.exe" -f
  CMakeFiles\cmTC_62b41.dir\build.make /nologo -L
  CMakeFiles\cmTC_62b41.dir\build

  Building C object CMakeFiles/cmTC_62b41.dir/testCCompiler.c.obj

        C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe
  @C:\Users\babel\AppData\Local\Temp\nm7D7D.tmp

  testCCompiler.c

  Linking C executable cmTC_62b41.exe

        "C:\Program Files (x86)\CMake\bin\cmake.exe" -E vs_link_exe
  --intdir=CMakeFiles\cmTC_62b41.dir --manifests --
  C:\PROGRA~2\MICROS~1.0\VC\bin\link.exe /nologo
  @CMakeFiles\cmTC_62b41.dir\objects1.rsp
  @C:\Users\babel\AppData\Local\Temp\nm7DDC.tmp

  RC Pass 1 failed to run.

  NMAKE : fatal error U1077: '"C:\Program Files (x86)\CMake\bin\cmake.exe"' :
  return code '0xffffffff'

  Stop.

  NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
  14.0\VC\bin\nmake.exe"' : return code '0x2'

  Stop.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt


-- Configuring incomplete, errors occurred!
See also "C:/Users/babel/workspace/rez/example_packages/hello_world/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/babel/workspace/rez/example_packages/hello_world/build/CMakeFiles/CMakeError.log".
rez: BuildError: The cmake build system failed

However, if I just use cmake directly to build the hello_world project, I get this successful output from cmake

NOTE: obviously, I have to remove everything except the cmake_minimum_required command from the build file, but the C compiler tests complete succesfully using cmake and not with rez.


-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.24210.0
-- The CXX compiler identification is MSVC 19.0.24210.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/babel/workspace/rez/example_packages/hello_world

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:25 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
willjpcommented, Apr 6, 2018

Hey Guys!

This isn’t the most ideal solution yet (running vcvarsall.bat is very slow), but it does fit into rez’s workflow, and cmake works as expected. If this is all fairly obvious, I’m sorry. I am new to both rez and software compilation on windows.

1) Get a Compiler

You can’t compile without a compiler. Firstly, make sure you actually have one. You can install cmake and the microsoft build tools most easily using chocolatey).

choco install -y cmake
choco install -y visualstudio2017buildtools
choco install -y visualstudio2017-workload-vctools

2) Create a vscode Rez Package

Add a package for vscode right in your rez package repository. This package will call vcvarsall.bat and set up your cmd.exe’s environment variables

# directory structure:

$env:USERPROFILE\packages\
    vscode\
        x64_2017_14.13.2612\
            package.py

...\vscode\x64_2017_14.13.2512\package.py

uuid = 'b9be08860d4e4f32bb5c861fce92f268'
name = 'vscode'
version = 'x64_2017_14.13.2612'

def commands():
    vcvarsall = 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Auxiliary\\Build\\vcvarsall.bat'
    command( '"{}" x64'.format(vcvarsall) )

3) Create a 2nd Rez Package (one to compile with cmake)

We’ll build this package normally using rez-build. Create it somewhere other than your rez package repository.

2nd Package Structure

package/
    emptyfile.txt         # just something arbitrary to package
    CMakeLists.txt
    package.py

CMakeLists.txt

cmake_minimum_required(VERSION 3.0)

include(RezBuild)

rez_install_files(
    emptyfile.txt
    DESTINATION .
)

package.py

import sys
uuid = '...' # some uuid
name = 'cmaketest'
version = '0.0.a1'

build_requires = []
if sys.platform == 'win32':
    build_requires.append('vscode')

4) rez-build

Now you can run rez-build, and both cmake and NMake’s will run vcvarsall.bat , so your path and the myriad of other computer-specific variables required to compile in windows.

cd $your_package
rez-build
0reactions
nerdvegascommented, Sep 21, 2018

Just a note - build_command is preferrable to bez, as I would like to deprecate bez.

<snip from google group>

I would like to deprecate bez in favor of custom build commands ( https://github.com/nerdvegas/rez/wiki/Building-Packages# custom-build-commands). Fortunately it is trivial to convert a rezbuild.py to a custom build command, like so:

 # in package.py
 build_command = "python {root}/rezbuild.py {install}"

# add this to rezbuild.py
if __name__ == '__main__':
    build(source_path=os.environ['REZ_BUILD_SOURCE_PATH'],
        build_path=os.environ['REZ_BUILD_PATH'],
        install_path=os.environ['REZ_BUILD_INSTALL_PATH'],
        targets=sys.argv[1:])

Thx A

On Thu, Sep 20, 2018 at 10:29 PM, Thorsten Kaufmann < notifications@github.com> wrote:

We’re using bez (or now custom build commands to be exact) just to call cmake as there are some cmake issues on windows. I want to look into this, currently trying to free up resources to do some rez work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nerdvegas/rez/issues/348#issuecomment-423164900, or mute the thread https://github.com/notifications/unsubscribe-auth/ABjqSg8qUOIuW-BKtqag95JqOYywKBu5ks5uc4o-gaJpZM4KHDM_ .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error using rez on windows · Issue #348 - GitHub
I'm trying to build the hello_world example package provided with rez but I'm getting errors just doing the cmake compiler tests that I ......
Read more >
Getting started with rez and windows - Google Groups
I am using the git-bash terminal on windows 7 and I am just trying to get rez up and running to play ......
Read more >
rez Changelog - pyup.io
Fix rez executables aren't removed in windows install ... NoneType Error When Using `rez pip` on Windows ...
Read more >
Rez - mottosso
Rez lets you describe the environment you want in a natural way. ... You can get around this problem using piping. ... port...
Read more >
My Humble Pipeline [MHP] project - Tech-Artists.Org
On Windows we deploy bat file which points to Python.exe and scripts on server path. ... Rez could solve this problem, with either...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found