Building _amgio on windows. #1381
Unanswered
danielenriquez59
asked this question in
Q&A
Replies: 2 comments
-
For anyone following, I got a bit further with the information posted here: |
Beta Was this translation helpful? Give feedback.
0 replies
-
The next error I got when trying to build was a "getline()" undefined reference. This is because getline is not a standard C library function and is part of the POSIX package. i.e. the reference does not exist on Mingw/Windows builds. I had to replace all occurrences of getline with fgets. Hope this doesn't break anything in the future. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Upfront: I am running a mingw-64 terminal on windows as suggested in the SUAVE build instructions.
From another thread, it was suggested to go into SU2\externals\AMGIO\su2io and try to manually build the _amgio
When I run the command 'python setup.py build_ext -c mingw32' I get the following output.
running build_ext building '_amgio' extension swigging ./sources/Python3.7/amgio_py.i to ./sources/Python3.7/amgio_py_wrap.c C:\Softwares\swigwin-4.0.2\swig.exe -python -o ./sources/Python3.7/amgio_py_wrap.c ./sources/Python3.7/amgio_py.i creating build creating build\temp.win-amd64-3.8 creating build\temp.win-amd64-3.8\Release creating build\temp.win-amd64-3.8\Release\sources creating build\temp.win-amd64-3.8\Release\sources\python3.7 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/amgio_py.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\amgio_py.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 ./sources/Python3.7/amgio_py.c: In function 'py_WriteMeshAndSol': ./sources/Python3.7/amgio_py.c:628:28: warning: '.csv' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.csv", BasNamSol); ^~~~ ./sources/Python3.7/amgio_py.c:628:9: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.csv", BasNamSol); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/amgio_py.c:624:28: warning: '.dat' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.dat", BasNamSol); ^~~~ ./sources/Python3.7/amgio_py.c:624:9: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.dat", BasNamSol); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/amgio_py.c:614:26: warning: '.solb' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.solb", BasNamSol); ^~~~~ ./sources/Python3.7/amgio_py.c:614:7: note: 'sprintf' output between 6 and 1029 bytes into a destination of size 1024 sprintf(OutSol, "%s.solb", BasNamSol); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/mesh.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\mesh.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/GMFio.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\gmfio.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/SU2io.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\su2io.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 ./sources/Python3.7/SU2io.c: In function 'LoadSU2Elements': ./sources/Python3.7/SU2io.c:231:51: warning: variable 'idx' set but not used [-Wunused-but-set-variable] int iElt, NbrElt=0, typ, is[8], swi[8], buf, s, idx, res; ^~~ ./sources/Python3.7/SU2io.c: In function 'LoadSU2ConnData': ./sources/Python3.7/SU2io.c:466:51: warning: variable 'idx' set but not used [-Wunused-but-set-variable] int iElt, NbrElt=0, typ, is[8], swi[8], buf, s, idx, res; ^~~ ./sources/Python3.7/SU2io.c: In function 'GetSU2SolSize': ./sources/Python3.7/SU2io.c:787:3: warning: implicit declaration of function 'getline'; did you mean 'getenv'? [-Wimplicit-function-declaration] getline(&lin, &len, FilHdl); ^~~~~~~ getenv ./sources/Python3.7/SU2io.c: In function 'WriteSU2SolutionBin': ./sources/Python3.7/SU2io.c:1317:10: warning: variable 'ret' set but not used [-Wunused-but-set-variable] size_t ret; ^~~ ./sources/Python3.7/SU2io.c:1339:5: warning: 'strncpy' specified bound 33 equals destination size [-Wstringop-truncation] strncpy(str_buf, SolTag[i], CGNS_STRING_SIZE); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/option.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\option.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 ./sources/Python3.7/option.c: In function 'CheckOptions': ./sources/Python3.7/option.c:46:32: warning: '.o' directive writing 2 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(mshopt->OutNam, "%s.o", mshopt->BasNam); ^~ ./sources/Python3.7/option.c:46:5: note: 'sprintf' output between 3 and 1026 bytes into a destination of size 1024 sprintf(mshopt->OutNam, "%s.o", mshopt->BasNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/libmesh6.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\libmesh6.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/amgio_py_wrap.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\amgio_py_wrap.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -IC:\Users\Danie\Anaconda3\envs\vsptools\include -IC:\Users\Danie\Anaconda3\envs\vsptools\include -c ./sources/Python3.7/convert.c -o build\temp.win-amd64-3.8\Release\.\sources\python3.7\convert.o -std=c99 -Wno-unused-variable -Wno-unused-result -O3 ./sources/Python3.7/convert.c: In function 'SplitSolution': ./sources/Python3.7/convert.c:191:7: warning: variable 'iTemp' set but not used [-Wunused-but-set-variable] int iTemp = -1; ^~~~~ ./sources/Python3.7/convert.c: In function 'ConvertGMFtoSU2Sol': ./sources/Python3.7/convert.c:32:26: warning: '.csv' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.csv", mshopt->OutNam); ^~~~ ./sources/Python3.7/convert.c:32:7: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.csv", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/convert.c:28:26: warning: '.dat' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.dat", mshopt->OutNam); ^~~~ ./sources/Python3.7/convert.c:28:7: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.dat", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/convert.c: In function 'ConvertGMFWithBoundtoSU2Sol': ./sources/Python3.7/convert.c:82:26: warning: '.csv' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.csv", mshopt->OutNam); ^~~~ ./sources/Python3.7/convert.c:82:7: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.csv", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/convert.c:78:26: warning: '.dat' directive writing 4 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.dat", mshopt->OutNam); ^~~~ ./sources/Python3.7/convert.c:78:7: note: 'sprintf' output between 5 and 1028 bytes into a destination of size 1024 sprintf(OutSol, "%s.dat", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/convert.c: In function 'ConvertGMFSoltoMet': ./sources/Python3.7/convert.c:114:22: warning: '.solb' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutMet, "%s.solb", mshopt->OutNam); ^~~~~ ./sources/Python3.7/convert.c:114:3: note: 'sprintf' output between 6 and 1029 bytes into a destination of size 1024 sprintf(OutMet, "%s.solb", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ./sources/Python3.7/convert.c: In function 'ConvertSU2SolToGMF': ./sources/Python3.7/convert.c:143:24: warning: '.solb' directive writing 5 bytes into a region of size between 1 and 1024 [-Wformat-overflow=] sprintf(OutSol, "%s.solb", mshopt->OutNam); ^~~~~ ./sources/Python3.7/convert.c:143:5: note: 'sprintf' output between 6 and 1029 bytes into a destination of size 1024 sprintf(OutSol, "%s.solb", mshopt->OutNam); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ writing build\temp.win-amd64-3.8\Release\.\sources\python3.7\_amgio.cp38-win_amd64.def creating build\lib.win-amd64-3.8 C:\Program Files\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin\gcc.exe -shared -s build\temp.win-amd64-3.8\Release\.\sources\python3.7\amgio_py.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\mesh.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\gmfio.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\su2io.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\option.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\libmesh6.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\amgio_py_wrap.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\convert.o build\temp.win-amd64-3.8\Release\.\sources\python3.7\_amgio.cp38-win_amd64.def -LC:\Users\Danie\Anaconda3\envs\vsptools\libs -LC:\Users\Danie\Anaconda3\envs\vsptools\PCbuild\amd64 -lpython38 -lmsvcr140 -o build\lib.win-amd64-3.8\_amgio.cp38-win_amd64.pyd C:/Program Files/mingw-w64/x86_64-8.1.0-posix-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmsvcr140 collect2.exe: error: ld returned 1 exit status error: command 'C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gcc.exe' failed with exit status 1
Beta Was this translation helpful? Give feedback.
All reactions