rlguy / GridFluidSim3D

A PIC/FLIP fluid simulation based on the methods found in Robert Bridson's "Fluid Simulation for Computer Graphics"
zlib License
786 stars 95 forks source link

unable to load library #14

Closed KimMura closed 6 years ago

KimMura commented 6 years ago

Can anyone give me some insight, why I receive the 'unable to load library" error ? I followed the instructions for installing fluidsim. However, I'm missing the "lib" directory under "pyfluid". Might this be the reason, and if so, how come the "lib" directory isn't there although the build was successful ?

Many thanks in advance !

h:\python27\python example_hello_world.py ../../../../build2/fluidsim/ Traceback (most recent call last): File "example_hello_world.py", line 30, in import pyfluid File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid__init.py", line 1, in from .aabb import AABB, AABB_t File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid\aabb.py", line 3, in from . import method_decorators as decorators File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid\method_decorators.py", line 3, in from .fluidsimulationsavestate import FluidSimulationSaveState File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid\fluidsimulationsavestate.py", line 4, in from .pyfluid import pyfluid as lib File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid\pyfluid.py", line 45, in pyfluid = __load_library("pyfluid") File "H:\GridFluidSim3D-master\build2\fluidsim\pyfluid\pyfluid.py", line 26, in load_library raise LibraryLoadError("Unable to load library: " + name) pyfluid.pyfluid.LibraryLoadError: 'Unable to load library: pyfluid'

KimMura commented 6 years ago

this is the pyfluid dir, after the build of fluidsim:

dir

rlguy commented 6 years ago

Hello KimMura,

It does look like the issue is that the library is missing.

What CMake command did you use to set up the project? What was the output of the CMake command?

How did you compile the project (by using GNU Make, or an IDE)? What was the compile output?

KimMura commented 6 years ago

Hi rlguy,

I used the CMake GUI interface, as with the command line, CMake didn't find the compiler. Visual studio 14 2015 was used. I copied the OpenCL-Headers-Master (with the subdirs opencl10 to opencl22) under the GridFluidSim3D-master directory. Is that the correct place and do I need other files besides the opencl headers ? Thanks in advance !

Below you can find the output of the CMake GUI.

Selecting Windows SDK version to target Windows 10.0.15063. The C compiler identification is MSVC 19.0.24215.1 The CXX compiler identification is MSVC 19.0.24215.1 Check for working C compiler: F:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe Check for working C compiler: F:/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: F:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe Check for working CXX compiler: F:/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 Looking for CL_VERSION_2_2 Looking for CL_VERSION_2_2 - not found Looking for CL_VERSION_2_1 Looking for CL_VERSION_2_1 - not found Looking for CL_VERSION_2_0 Looking for CL_VERSION_2_0 - not found Looking for CL_VERSION_1_2 Looking for CL_VERSION_1_2 - found Found OpenCL: F:/CUDA/Development/lib/Win32/OpenCL.lib (found version "1.2") Configuring done Generating done

rlguy commented 6 years ago

Thanks for providing the CMake output. You won't need to place any OpenCL files in the project source directory.

It looks like CMake was able to find everything and generate the Visual Studio project correctly. The next step is to compile the program in the generated Visual Studio 2015 project. Compiling the program should create the 'lib' directory and the pyfluid library file.

Does the Visual Studio project compile correctly without errors?

KimMura commented 6 years ago

Oh my god... me so stupid !!!!!!! I didn't compile the program afterwards in VS 2015... Thank you so much Ryan for pointing this out, It compiles without errors and now the "lib" directory is added under pyfluid and I can run the examples :)

rlguy commented 6 years ago

No, problem! Good to hear that it's now working for you.