jxjo / Xoptfoil-JX

Xoptfoil-JX - modified version
GNU General Public License v3.0
14 stars 5 forks source link

Linux installation fails due to obsolete Fortran feature #19

Closed klausbu closed 4 years ago

klausbu commented 4 years ago

Hallo Jochen,

ich habe Probleme bei der Linux-Installation. Es beginnt bei 35% mit einigen Warnungen, gefolgt bei 82% von einer obsoleten Fortran-Anweisung. Der aktuelle Compiler meiner Distribution ist GNU 9.3 . Woran kann das liegen?

Gruß, Klaus


[ 35%] Building Fortran object CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.o
/usr/bin/gfortran -DPACKAGE_VERSION=\"1.2.0beta\"  -O3 -fopenmp -cpp -DWIN32=1   -c /home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/os_util.f90 -o CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.o
/home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/os_util.f90:204:0:

  204 |   hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE)
      | 
Warnung: Attribut »stdcall« wird ignoriert [-Wattributes]
/home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/os_util.f90:205:0:

  205 |   iresult = GetConsoleScreenBufferInfo(hConsoleOutput,lpConsoleScreenBufferInfo)
      | 
Warnung: Attribut »stdcall« wird ignoriert [-Wattributes]
/home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/os_util.f90:207:0:

  207 |   iresult = SetConsoleTextAttribute(hConsoleOutput,wAttributes)
      | 
Warnung: Attribut »stdcall« wird ignoriert [-Wattributes]
/usr/bin/cmake -E cmake_copy_f90_mod os_util.mod CMakeFiles/MYOBJLIB.dir/os_util.mod.stamp GNU

...

[ 82%] Building Fortran object CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_math.f.o
/usr/bin/gfortran -DPACKAGE_VERSION=\"1.2.0beta\"  -O3 -fopenmp -cpp -DWIN32=1   -fdefault-real-8 -c /home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/xfoil_deps/xfoil_math.f -o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_math.f.o
/home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/xfoil_deps/xfoil_math.f:239:72:

  239 |           IF(ABS(Z(N,NP))-ABS(Z(NX,NP))) 11,11,111
      |                                                                        1
Warnung: Fortran 2018: gelöschtes Feature: Arithmetische IF-Anweisung bei (1)
make[2]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird verlassen
[ 82%] Built target MYOBJLIB
make  -f CMakeFiles/xoptfoil-JX.dir/build.make CMakeFiles/xoptfoil-JX.dir/depend
make[2]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird betreten
cd /home/klaus/OpenFOAM/Xoptfoil-JX/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/klaus/OpenFOAM/Xoptfoil-JX /home/klaus/OpenFOAM/Xoptfoil-JX /home/klaus/OpenFOAM/Xoptfoil-JX/build /home/klaus/OpenFOAM/Xoptfoil-JX/build /home/klaus/OpenFOAM/Xoptfoil-JX/build/CMakeFiles/xoptfoil-JX.dir/DependInfo.cmake --color=
Dependee "/home/klaus/OpenFOAM/Xoptfoil-JX/build/CMakeFiles/xoptfoil-JX.dir/DependInfo.cmake" is newer than depender "/home/klaus/OpenFOAM/Xoptfoil-JX/build/CMakeFiles/xoptfoil-JX.dir/depend.internal".
Dependee "/home/klaus/OpenFOAM/Xoptfoil-JX/build/CMakeFiles/CMakeDirectoryInformation.cmake" is newer than depender "/home/klaus/OpenFOAM/Xoptfoil-JX/build/CMakeFiles/xoptfoil-JX.dir/depend.internal".
Scanning dependencies of target xoptfoil-JX
make[2]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird verlassen
make  -f CMakeFiles/xoptfoil-JX.dir/build.make CMakeFiles/xoptfoil-JX.dir/build
make[2]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird betreten
[ 85%] Building Fortran object CMakeFiles/xoptfoil-JX.dir/src/fortran/main.f90.o
/usr/bin/gfortran -DPACKAGE_VERSION=\"1.2.0beta\"  -O3 -fopenmp -cpp -DWIN32=1   -c /home/klaus/OpenFOAM/Xoptfoil-JX/src/fortran/main.f90 -o CMakeFiles/xoptfoil-JX.dir/src/fortran/main.f90.o
[ 88%] Linking Fortran executable xoptfoil-JX
/usr/bin/cmake -E cmake_link_script CMakeFiles/xoptfoil-JX.dir/link.txt --verbose=1
/usr/bin/gfortran   -O3 -fopenmp -cpp -DWIN32=1 CMakeFiles/xoptfoil-JX.dir/src/fortran/main.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/airfoil_evaluation.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/airfoil_operations.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/genetic_algorithm.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/input_output.F90.o CMakeFiles/MYOBJLIB.dir/src/fortran/input_sanity.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/math_deps.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/memory_util.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/naca.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/optimization_driver.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/optimization_util.F90.o CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/parametrization.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/particle_swarm.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/polar_opartions.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/simplex_search.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/vardef.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/blpar_inc.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/my_equivalence.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xbl_inc.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_driver.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_inc.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/naca456_deps/epspsi.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/naca456_deps/nacax.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/naca456_deps/splprocs.f90.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_aero.f.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_bl.f.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_geom.f.o CMakeFiles/MYOBJLIB.dir/src/fortran/xfoil_deps/xfoil_math.f.o  -o xoptfoil-JX 
/usr/bin/ld: CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.o: in function `__os_util_MOD_print_colored_windows':
os_util.f90:(.text+0x200): undefined reference to `GetStdHandle'
/usr/bin/ld: os_util.f90:(.text+0x20e): undefined reference to `GetConsoleScreenBufferInfo'
/usr/bin/ld: os_util.f90:(.text+0x218): undefined reference to `SetConsoleTextAttribute'
/usr/bin/ld: os_util.f90:(.text+0x2ab): undefined reference to `SetConsoleTextAttribute'
collect2: Fehler: ld gab 1 als Ende-Status zurück
make[2]: *** [CMakeFiles/xoptfoil-JX.dir/build.make:160: xoptfoil-JX] Fehler 1
make[2]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird verlassen
make[1]: *** [CMakeFiles/Makefile2:102: CMakeFiles/xoptfoil-JX.dir/all] Fehler 2
make[1]: Verzeichnis „/home/klaus/OpenFOAM/Xoptfoil-JX/build“ wird verlassen
make: *** [Makefile:150: all] Fehler 2
jxjo commented 4 years ago

Hallo Klaus, (ich hoffe, es ist ok, wenn ich auf Englisch antworte?)

... oh! - cmake tries to make a compile for windows. See the flag -DWIN32=1 ... strange

In build_linux.sh the shell variable TARGET_OS=UNIX is set - and this should control in CMakeLists.txt the OS flag

if($ENV{TARGET_OS} MATCHES "UNIX")
  set (OS_FLAG "-DUNIX=1")
  message (STATUS "\n \n   Building XFoptfoil-JX Version $ENV{XOPTFOIL_VERSION} for UNIX\n\n")
else ($ENV{TARGET_OS} MATCHES "UNIX")
  set (OS_FLAG "-DWIN32=1")  
  message (STATUS "\n \n   Building XFoptfoil-JX Version $ENV{XOPTFOIL_VERSION} for Windows\n\n")
endif ($ENV{TARGET_OS} MATCHES "UNIX") 

Could you find out why the OS_FLAG is not set at this point? Sorry, I do not have Linux ...

Maybe user joyo44 (John) could help?

regards

Jochen

klausbu commented 4 years ago

Thank you for the hint, I edited CMakeLists.txt and set the OS_FLAG in there, the following error was related to the generation of the User_Guide.pdf and example_case.pdf which had failed. As a workaround, I added and renamed two pdf files I had at hand and the installation worked.

I would also recommend to make: set(ENABLE_OPENMP TRUE CACHE BOOL "Whether to build with OpenMP support." ) the default as multicore CPUs are standard.

jxjo commented 4 years ago

Hello Klaus, ... I think I got it. I had changed the original build-jobs and als CMakeLists.txt. So it's not true, that an original Xoptfoil and Xoptfoil-JX can coexist in a single directory for compilation... Shame on me. I'll rename the files in the next release...

I switched off multi threading because I had some strange effects and the overall gain in speed was minor (at least on my little PC). I suppose that the console output when 'show_details' is activated, would be a little 'confused'...

Thanks for your support!

jxjo commented 4 years ago

... hopefully fixed now ...