Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking Errors and Undefined References while Building PyNE on Windows #1513

Open
ahnaf-tahmid-chowdhury opened this issue Nov 26, 2023 · 0 comments

Comments

@ahnaf-tahmid-chowdhury
Copy link
Member

Issue Description:

When attempting to build PyNE on Windows using both Unix Makefiles and MinGW Makefiles, the build process encounters linking errors and undefined references. The error messages suggest issues with exporting symbols and unresolved references to functions in the enrichment.cpp file. Additionally, there are warnings about a corrupt .drectve at the end of the def file.

Error Messages:

[ 23%] Linking CXX shared library libpyne.dll
cd /d D:\a\PyNE\PyNE\_skbuild\win-amd64-3.9\cmake-build\src && C:\Users\runneradmin\AppData\Local\Temp\build-env-xaifyi18\Lib\site-packages\cmake\data\bin\cmake.exe -E cmake_link_script CMakeFiles\pyne.dir\link.txt --verbose=1
C:\Users\runneradmin\AppData\Local\Temp\build-env-xaifyi18\Lib\site-packages\cmake\data\bin\cmake.exe -E rm -f CMakeFiles\pyne.dir/objects.a
C:\mingw64\bin\ar.exe qc CMakeFiles\pyne.dir/objects.a @CMakeFiles\pyne.dir\objects1.rsp
C:\mingw64\bin\c++.exe  -D__WIN_GNUC__ -DJSON_IS_AMALGAMATION -O3 -DNDEBUG -shared -o libpyne.dll -Wl,--out-implib,libpyne.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles\pyne.dir/objects.a -Wl,--no-whole-archive @CMakeFiles\pyne.dir\linkLibs.rsp
Warning: corrupt .drectve at end of def file

more log

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export __local_stdio_printf_options: symbol not defined
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export __local_stdio_scanf_options: symbol not defined
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export _vfprintf_l: symbol not defined

more similar log...

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\pyne.dir/objects.a(enrichment.cpp.obj):enrichment.cpp:(.text+0x62f6): undefined reference to `pyne::enrichment::solve_symbolic(pyne::enrichment::Cascade&)'
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles\pyne.dir/objects.a(enrichment.cpp.obj):enrichment.cpp:(.text+0x6806): undefined reference to `pyne::enrichment::solve_symbolic(pyne::enrichment::Cascade&)'

more similar log...

collect2.exe: error: ld returned 1 exit status
mingw32-make.exe[2]: *** [src\CMakeFiles\pyne.dir\build.make:425: src/libpyne.dll] Error 1
mingw32-make.exe[2]: Leaving directory 'D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build'
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:206: src/CMakeFiles/pyne.dir/all] Error 2
mingw32-make.exe[1]: Leaving directory 'D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build'
mingw32-make.exe: *** [Makefile:138: all] Error 2


[ 23%] Linking CXX shared library libpyne.dll
cd D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build/src && C:/Users/runneradmin/AppData/Local/Temp/build-env-1kii98zd/Lib/site-packages/cmake/data/bin/cmake.exe -E rm -f CMakeFiles/pyne.dir/objects.a
cd D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build/src && C:/mingw64/bin/ar.exe qc CMakeFiles/pyne.dir/objects.a @CMakeFiles/pyne.dir/objects1.rsp
cd D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build/src && C:/mingw64/bin/c++.exe  -D__WIN_GNUC__ -DJSON_IS_AMALGAMATION -O3 -DNDEBUG -shared -o libpyne.dll -Wl,--out-implib,libpyne.dll.a -Wl,--major-image-version,0,--minor-image-version,0 -Wl,--whole-archive CMakeFiles/pyne.dir/objects.a -Wl,--no-whole-archive @CMakeFiles/pyne.dir/linkLibs.rsp
Warning: corrupt .drectve at end of def file

more similar log...

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export __local_stdio_printf_options: symbol not defined
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export __local_stdio_scanf_options: symbol not defined
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot export _vfprintf_l: symbol not defined

more similar log...

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/pyne.dir/objects.a(enrichment.cpp.obj):enrichment.cpp:(.text+0x62f6): undefined reference to `pyne::enrichment::solve_symbolic(pyne::enrichment::Cascade&)'
C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: CMakeFiles/pyne.dir/objects.a(enrichment.cpp.obj):enrichment.cpp:(.text+0x6806): undefined reference to `pyne::enrichment::solve_symbolic(pyne::enrichment::Cascade&)'

more similar log...

C:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Miniconda/Library/lib/libhdf5.lib(src/CMakeFiles/hdf5-static.dir/H5EAtest.c.obj):(.xdata[$unwind$H5EA__test_debug]+0x10): undefined reference to `__GSHandlerCheck'
collect2.exe: error: ld returned 1 exit status
gmake.exe[2]: *** [src/CMakeFiles/pyne.dir/build.make:427: src/libpyne.dll] Error 1
gmake.exe[2]: Leaving directory 'D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build'
gmake.exe[1]: *** [CMakeFiles/Makefile2:207: src/CMakeFiles/pyne.dir/all] Error 2
gmake.exe[1]: Leaving directory 'D:/a/PyNE/PyNE/_skbuild/win-amd64-3.9/cmake-build'
gmake.exe: *** [Makefile:139: all] Error 2

Expected Behavior:

The PyNE build process should complete successfully without encountering linking errors or unresolved references.

Environment:

  • Operating System: Windows
  • Build System: MinGW and Cygwin

Additional Information:

The workflow contains the complete log.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant