Closed joyo44 closed 4 years ago
Hello John - uff - Linux rescue is near! ;-)
colors .. you are right, this can't work in the UNIX variant.. I'll change.
settings... I wonder how a setting in build_linux.sh can be transferred to cmake. From my poor linux understanding with
XOPTFOIL_VERSION=1.50.0
TARGET_OS=UNIX
a shell variable is set. Maybe it is needed to set the variables as environment variables with
export XOPTFOIL_VERSION=1.50.0
export TARGET_OS=UNIX
? Sorry for my lack of knowledge...
Jochen
Hello Jochen,
yes, the "normal" way is to export the shell variable - didn't work, got always WIN32 for OS. I think CMake has it's own cache environment so you have to pass the variable to CMake, but I'm not familiar with CMake (I create old school makefiles by hand).
John
Hi John, ... the COLOR issue is now fixed.
CMake is still strange as it works fine under Windows and documentation tells nothing special for LINUX. Mmh -did you delete the build directory before the build (caching problem)?
Thanks and regards
Jochen
Hi Jochen,
I have found a solution which works - and now shows also the version number on the sreen, which I missed.
here is my "build_linux" script:
BUILDDIR=build INSTALLDIR=$(pwd)/linux XOPTFOIL_VERSION=1.5.0beta TARGET_OS=UNIX
export XOPTFOIL_VERSION export TARGET_OS
if [ -d "$BUILDDIR" ]; then rm -Rf $BUILDDIR; fi if [ -d "$INSTALLDIR" ]; then rm -Rf $INSTALLDIR; fi
mkdir build cd build
cmake \ -DCMAKE_INSTALL_PREFIX:PATH="$INSTALLDIR" \ -DCMAKE_BUILD_TYPE:STRING="Release" \ .. make VERBOSE=1 || exit 1 make install || exit 1
cd ..
and the top lines in the "CMakeLists"
set(CMAKE_SYSTEM_NAME $ENV{TARGET_OS})
if(CMAKE_SYSTEM_NAME MATCHES "UNIX")
set (OS_FLAG "-DUNIX=1")
message (STATUS "\n \n Building XFoptfoil-JX Version $ENV{XOPTFOIL_VERSION} for UNIX\n\n")
else (CMAKE_SYSTEM_NAME MATCHES "WIN")
set (OS_FLAG "-DWIN32=1")
message (STATUS "\n \n Building XFoptfoil-JX Version $ENV{XOPTFOIL_VERSION} for Windows\n\n")
endif (CMAKE_SYSTEM_NAME MATCHES "UNIX")
Hope this helps.
Regards,
John
thanks John! (I added some "\" at the cmake command in build_linux. Hope this is correct)
Hi Jochen, I tried to build the new Release and got following error:
/usr/bin/gfortran -DPACKAGE_VERSION=\"\" -O3 -cpp -DUNIX=1 -c /home/john/Home_T420/XoptFoil/Xoptfoil-v1.50.0-JX/src/fortran/os_util.f90 -o CMakeFiles/MYOBJLIB.dir/src/fortran/os_util.f90.obj /home/john/Home_T420/XoptFoil/Xoptfoil-v1.50.0-JX/src/fortran/os_util.f90:178:10:
/home/john/Home_T420/XoptFoil/Xoptfoil-v1.50.0-JX/src/fortran/os_util.f90:182:10:
Error: CASE label at (1) overlaps with CASE label at (2)
It looks like COLOR_BAD and COLOR_ERROR have the same signature:
integer, parameter, public :: COLOR_ERROR = iany([COLOR_RED, COLOR_INTENS]) integer, parameter, public :: COLOR_BAD = iany([COLOR_RED, COLOR_INTENS])
may be the compiler didn't like that?
I had another issue with the build-scripts. Setting TARGET_OS=UNIX didn't work for me. In build_linux.sh I passed the CMAKE_SYSTEM_NAME with TARGET_OS:
cmake \ -DCMAKE_INSTALL_PREFIX:PATH="$INSTALLDIR" \ -DCMAKE_BUILD_TYPE:STRING="Release" \ -DCMAKE_SYSTEM_NAME="$TARGET_OS" \ ..
and in CmakeLists.txt I changed the if-statement to
if(CMAKE_SYSTEM_NAME MATCHES "UNIX")
That works for me.
Could you check that for Windows.
Regards,
John