Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
780 stars 201 forks source link

missing: USD_LIBRARY_DIR #397

Closed Pirminus closed 4 years ago

Pirminus commented 4 years ago

Hey there!

I tried to build USD for maya and stumbled across an error I'm not able to fix.

So basicly what my steps were:

x) get latest pixar usd branch 20.2 and build it with

python build_usd.py --python --usd-imaging --usdview --openimageio --opencolorio --alembic --draco --materialx C:\USD-Master --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem"

with success

x) next, I got the latest autodesk - usd dev branch

I set the env variables in PythonPath: C:\USD-Master\lib\python and in PATH: C:\USD-Master\bin & C:\USD-Master\lib

so I startet to put my command together for the build which is:

python build.py --generator Ninja --maya-location "C:\Program Files\Autodesk\Maya2020" --pxrusd-location C:\USD-Master --devkit-location C:\devkitBase C:\USD_MAYA --build-args=-DCMAKE_MAKE_PROGRAM='C:\Users\Pirmin\Downloads\ninja-win\ninja.exe'

The error says that I'm missing some USD_LIBRARY_DIR from the Animal Logic (https://github.com/AnimalLogic/AL_USDMaya/blob/master/cmake/modules/FindUSD.cmake)

I think its looking for some libusd.dll in the lib folder. I also got the error about a missing usdGenSchema so I copied it from the repo (pxr/usd/usd/usdGenSchema.py) to C:\USD-Master\bin and removed the .py from the name and the error is gone.

Some help would be very much appreciated

Kind Regards Pirmin

CMakeCache.txt build_log.txt

HamedSabri-adsk commented 4 years ago

Hi @Pirminus , you don't need to set the env variables for PYTHONPATH and PATH in order to build mayaUsd.

Both PATH and PYTHONPATH are automatically adjusted inside the project to point to the correct USD location. See cmake/usd.cmake.`

Pirminus commented 4 years ago

hi @HamedSabri-adsk, thanks for the fast reply. I'm forcing a rebuild of the whole Pixar USD Repo which is gonna take a few more minutes then I'll try it without setting the env variables.

Pirminus commented 4 years ago

yeah, so I did not change any env variables and the same error still appears

Could NOT find USD (missing: USD_LIBRARY_DIR) (found version "0.20.2")

CMakeCache.txt

build_log.txt

HamedSabri-adsk commented 4 years ago

There are couple of things that I am trying to understand:

The error says that I'm missing some USD_LIBRARY_DIR from the Animal Logic (https://github.com/AnimalLogic/AL_USDMaya/blob/master/cmake/modules/FindUSD.cmake)

I am not sure if I understand the link to AL's FindUSD.cmake. We use the FindUSD.cmake module under cmake/modules.

I think its looking for some libusd.dll in the lib folder. I also got the error about a missing usdGenSchema so I copied it from the repo (pxr/usd/usd/usdGenSchema.py) to C:\USD-Master\bin and removed the .py from the name and the error is gone.

On Windows, the shared libraries don't have the "lib" prepended to them. You should be able to see usd.dll under C:\USD-Master\lib.

When you build USD with --usdview, usdGenSchema should be automatically generated for you. Also, I don't recommend modification to the binaries manually after install.

For the sake of experiment, I would try to build USD with these flags first and see if you can reproduce the problem:

python build_usd.py C:\USD-Master --build-args boost,"--with-date_time --with-thread --with-system --with-filesystem"

Pirminus commented 4 years ago

The error says that I'm missing some USD_LIBRARY_DIR from the Animal Logic (https://github.com/AnimalLogic/AL_USDMaya/blob/master/cmake/modules/FindUSD.cmake)

I am not sure if I understand the link to AL's FindUSD.cmake. We use the FindUSD.cmake module under cmake/modules.

yeah, I was confused by some other repositories I found online from AL's github and yes I see a directory named 'lib' inside USD-Master and a usd.dll.

So I did a build the USD just with the args you wrote and it succeeded but the error still shows up as soon as building the autodesk usd plugin.

One thing did change, the usdGenSchema was created, so its only the missing USD_LIBRARY_DIR.

Build Command: python build.py --generator "Ninja" --maya-location "C:\Program Files\Autodesk\Maya2020" --pxrusd-location C:\USD-Master --devkit-location C:\devkitBase C:\USD_MAYA --build-args=-DCMAKE_MAKE_PROGRAM='C:\Users\Pirmin\Downloads\ninja-win\ninja.exe'

usd-master_success CMakeCache.txt build_log.txt

HamedSabri-adsk commented 4 years ago

@Pirminus could you post what you have in your ENV path? I wonder if you have another path to USD in your global environment path.

Pirminus commented 4 years ago

yeah sure, echo %PATH% from cmd gives me:


C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64_win\compiler;
C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\intel64\compiler;
C:\ProgramData\Oracle\Java\javapath;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\Program Files (x86)\GtkSharp\2.12\bin;
C:\Program Files\Common Files\Autodesk Shared\;
C:\Program Files (x86)\Autodesk\Backburner\;
C:\Program Files (x86)\QuickTime\QTSystem\;
C:\Program Files (x86)\Skype\Phone\;
C:\WINDOWS\System32\OpenSSH\;
C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;
C:\Program Files\Git\cmd;
C:\Program Files\dotnet\;
C:\Program Files\NVIDIA Corporation\NVIDIA NvDLISR;
C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;
C:\WINDOWS\system32;
C:\WINDOWS;
C:\WINDOWS\System32\Wbem;
C:\WINDOWS\System32\WindowsPowerShell\v1.0\;
C:\WINDOWS\System32\OpenSSH\;
C:\Program Files\3Delight\bin;
C:\Python27;C:\Python27\Scripts;
C:\Users\Pirmin\Downloads\cmake-3.17.0-win32-x86\cmake-3.17.0-win32-x86\bin;
C:\Program Files\NASM;
C:\Users\Pirmin\AppData\Local\Microsoft\WindowsApps;
$RMANTREE/bin;
C:\Python27;
C:\Python27\Scripts;
C:\MinGW\bin;
C:\Users\Pirmin\Downloads\cmake-3.17.0-win32-x86\cmake-3.17.0-win32-x86\bin;
C:\Program Files\NASM;
HamedSabri-adsk commented 4 years ago

Hmm, this is pretty strange behaviour... I guess it is time to print out some stuff to see what is happening. From your log I can see the USD_INCLUDE_DIR is populated correctly but not USD_LIBRARY_DIR.

-- USD include dir: C:/USD-Master/include
-- USD library dir: 

Can you print out ${USD_LIBRARY},${USD_LIB_PREFIX},${USD_LIB_SUFFIX} right after line 53 in FindUSD.cmake?

message("USD_LIBRARY =" ${USD_LIBRARY} )
message("USD_LIB_PREFIX =" ${USD_LIB_PREFIX} )
message("USD_LIB_SUFFIX =" ${USD_LIB_SUFFIX} )
get_filename_component(USD_LIBRARY_DIR ${USD_LIBRARY} DIRECTORY)
Pirminus commented 4 years ago

yes sure, here it is:


-- The CXX compiler identification is GNU 9.2.0
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe
-- Check for working CXX compiler: C:/MinGW/bin/c++.exe - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Python: C:/Python27/python.exe (found suitable exact version "2.7.16") found components: Interpreter 
-- _PYTHON_VERSION_LIST: 2.7.16.final.0
-- PYTHON_PREFIX: C:\Python27
-- PYTHON_INCLUDE_DIR: C:\Python27\include
-- PYTHON_SITE_PACKAGES: C:\Python27\Lib\site-packages
-- PYTHON_MODULE_EXTENSION: .pyd
-- PYTHON_IS_DEBUG: 0
-- PYTHON_SIZEOF_VOID_P: 8
-- PYTHON_LIBRARY_SUFFIX: 27
-- PYTHON_LIBDIR: 
-- PYTHON_MULTIARCH: 
-- Building with Python:
--    PYTHON_INCLUDE_DIRS = 
--    PYTHON_LIBRARIES    = 
--    Python_EXECUTABLE   = C:/Python27/python.exe
-- Found Maya: C:/Program Files/Autodesk/Maya2020/bin/maya.exe (found version "2020") 
USD_LIBRARY =USD_LIBRARY-NOTFOUND
USD_LIB_PREFIX =lib
USD_LIB_SUFFIX =.a
-- USD include dir: C:/USD-Master/include
-- USD library dir: 
-- USD version: 0.20.2
CMake Error at C:/Users/Pirmin/Downloads/cmake-3.17.0-win32-x86/cmake-3.17.0-win32-x86/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:164 (message):
  Could NOT find USD (missing: USD_LIBRARY_DIR) (found version "0.20.2")
Call Stack (most recent call first):
  C:/Users/Pirmin/Downloads/cmake-3.17.0-win32-x86/cmake-3.17.0-win32-x86/share/cmake-3.17/Modules/FindPackageHandleStandardArgs.cmake:445 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindUSD.cmake:116 (find_package_handle_standard_args)
  CMakeLists.txt:91 (find_package)

build_log.txt

CMakeCache.txt

HamedSabri-adsk commented 4 years ago

There is your problem right there. :) You are on Windows and yet the variables are populated with Linux values which is strange. .a is a static library and on Linux all libraries are prefixed with lib

USD_LIB_PREFIX =lib
USD_LIB_SUFFIX =.a

This is what you should get

USD_LIBRARY =C:/USD2002/lib/usd.lib
USD_LIB_PREFIX =
USD_LIB_SUFFIX =.lib

Can you confirm that you are running the build.py script from X64 Visual studio command prompt?

Also, I would get rid of "C:\MinGW\bin;" from the global ENV settings.

Pirminus commented 4 years ago

yeah, it did successfully compile MayaUSD! removed the MinGW from the ENV settings & made sure I was running from x64 command prompt

thanks alot for your patience and time @HamedSabri-adsk , really much appreciated!!

just one more thing before this issue can be closed:

What would be the difference in building the maya-usd plugin with the usd-master build without opencolorio,draco, materialx etc ? Am I going to miss some features in maya ?

Thanks again and kind regards Pirmin

HamedSabri-adsk commented 4 years ago

@Pirminus glad it works.

At the moment, you don't need to build USD with opencolorio,draco, materialx APIs. The only requirement are the boost flags which hopefully soon will be gone :)

Please refer to the requirement table in the build doc for the latest instructions.

https://github.com/Autodesk/maya-usd/blob/dev/doc/build.md