- edited description
VectorFunctionSpace JIT compile is not working on mingw
this simple example is not working after update to dijitso
mesh = UnitSpaceMesh(100,100)
V = VectorFunctionSpace(mesh,'CG',1)
the compile command that's failing is below. All the files are there but somehow the linker is not finding -ldijitso-ffc_element_d9ff644853cc218e8f962af6a3778b698bb71081
c++ -Wall -shared -fPIC -std=c++11 -O2 -IC:/msys64/mingw64/lib/python2.7/site-packages/ffc-2016.2.0.dev0-py2.7.egg/ffc/backends/ufc -IC:/msys64/home/chaffra/.cache/dijitso/include ffc_element_a362cff3edcbc48f60bbc43ddaf51e8067dd99bf.cpp -LC:/msys64/home/chaffra/.cache/dijitso/lib -Wl,-rpath,C:/msys64/home/chaffra/.cache/dijitso/lib -ldijitso-ffc_element_d9ff644853cc218e8f962af6a3778b698bb71081 -olibdijitso-ffc_element_a362cff3edcbc48f60bbc43ddaf51e8067dd99bf.so
But
mesh = UnitSpaceMesh(100,100)
Q = FunctionSpace(mesh,'CG',1)
which is not linking to anything compiles fine.
Comments (12)
-
reporter -
reporter - changed title to VectorFunctionSpace JIT compile is not working on mingw
-
reporter - edited description
-
reporter - edited description
-
Is the compiler g++? When you run the example code, a directory "jitfailure..." should be created. Can you post the error log found in there?
-
- changed milestone to 2016.2
-
assigned issue to
-
reporter Here is the command being ran:
c++ -Wall -shared -fPIC -std=c++11 -O2 -IC:/msys64/mingw64/lib/python2.7/site-packages/ffc-2016.2.0.dev0-py2.7.egg/ffc/backends/ufc -IC:/msys64/home/chaffra/.cache/dijitso/include ffc_element_e9df002726ec.cpp -LC:/msys64/home/chaffra/.cache/dijitso/lib -Wl,-rpath,C:/msys64/home/chaffra/.cache/dijitso/lib -ldijitso-ffc_element_3e92f51a1da5 -olibdijitso-ffc_element_e9df002726ec.so
Here is the error log. Yes the compiler is g++.
C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/6.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -ldijitso-ffc_element_3e92f51a1da5 collect2.exe: error: ld returned 1 exit status
The following hack seems to do the trick but I don't know why it's not working with
-L
.if sys.platform == 'win32': for lib in deplibs: full_lib_filename = os.path.join(lib_dir, cache_params['lib_prefix']+lib+cache_params['lib_postfix'] ) args.append(os.path.abspath(full_lib_filename)) else: args.extend("-l" + lib for lib in deplibs)
But that assumes deplibs only contains libraries in
.cache/dijitso/lib
. -
Can you try changing the lib_postfix in dijitso/params.py from ".so" to ".dll"?
Without the absolute path change you did here.
-
I've pushed a branch to dijitso with that change, you can test this instead of doing the change yourself if you want:
https://bitbucket.org/fenics-project/dijitso/branch/martinal/topic-dll-on-windows
-
reporter Great it works. I had forgotten .dll should be used for windows.
-
Great. Fix is in dijitso next, will be merged to master on monday.
-
- changed status to resolved
- Log in to comment