rice-solar-physics / HYDRAD

HYDrodynamics and RADiation Code for computing solutions to field-aligned hydrodynamic equations in coronal loops
MIT License
9 stars 4 forks source link

GCC version issues on Linux CentOS #93

Open weaselskinghenry opened 2 years ago

weaselskinghenry commented 2 years ago

Trying to run HYDRAD on Linux CentOS is giving the following error:

> ./HYDRAD.bat 
../../Resources/Utils/regPoly/regpoly.cpp: In function ‘gaussj(double**, int, double**, int)’:
../../Resources/Utils/regPoly/regpoly.cpp:97:12: warning: ‘irow’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 int i,icol,irow,j,k,l,ll;
            ^
../../Resources/Utils/regPoly/regpoly.cpp:124:15: warning: ‘icol’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  indxc[i]=icol;
               ^
./HYDRAD.bat: line 5: 39483 Segmentation fault      (core dumped) ./HYDRAD.exe > HYDRAD.txt

Investigating the compiler:

> gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-redhat-linux/4.8.5/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-bootstrap --enable-shared --enable-threads=posix --enable-checking=release --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-linker-hash-style=gnu --enable-languages=c,c++,objc,obj-c++,java,fortran,ada,go,lto --enable-plugin --enable-initfini-array --disable-libgcj --with-isl=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/isl-install --with-cloog=/builddir/build/BUILD/gcc-4.8.5-20150702/obj-x86_64-redhat-linux/cloog-install --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
gcc version 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC) 
> scl enable devtoolset-10 bash
bash-4.2$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/opt/rh/devtoolset-10/root/usr/libexec/gcc/x86_64-redhat-linux/10/lto-wrapper
Target: x86_64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,lto --prefix=/opt/rh/devtoolset-10/root/usr --mandir=/opt/rh/devtoolset-10/root/usr/share/man --infodir=/opt/rh/devtoolset-10/root/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --with-linker-hash-style=gnu --with-default-libstdcxx-abi=gcc4-compatible --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-10.2.1-20210130/obj-x86_64-redhat-linux/isl-install --disable-libmpx --enable-gnu-indirect-function --with-tune=generic --with-arch_32=x86-64 --build=x86_64-redhat-linux
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 10.2.1 20210130 (Red Hat 10.2.1-11) (GCC)
bash-4.2$ ./HYDRAD.bat 
../../Resources/Utils/regPoly/regpoly.cpp: In function ‘gaussj(double**, int, double**, int)’:
../../Resources/Utils/regPoly/regpoly.cpp:97:12: warning: ‘irow’ may be used uninitialized in this function [-Wmaybe-uninitialized]
 int i,icol,irow,j,k,l,ll;
            ^
../../Resources/Utils/regPoly/regpoly.cpp:124:15: warning: ‘icol’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  indxc[i]=icol;
               ^
./HYDRAD.bat: line 5: 39751 Segmentation fault      (core dumped) ./HYDRAD.exe > HYDRAD.txt

So it's giving the same problem using both GCC v4 and v10; the exact same copy is running with no errors on a MBP running GCC v4.2.1. Any light shed on this would be appreciated!

wtbarnes commented 2 years ago

This is a runtime error, not a compilation error so I'm not sure that using a different version of GCC would make a difference. Oftentimes, a segmentation fault can occur, particularly on Linux, because of issues with case sensitivity in filenames that macOS and Windows are not sensitive to. Can you provide your particular HYDRAD setup? That might help debug this compilation error.

weaselskinghenry commented 2 years ago

Can you clarify what you mean by HYDRAD setup? I cloned a copy from Github in April, if that helps!

sjbradshaw commented 2 years ago

Try deleting that and cloning the most recent (current) version. I have run HYDRAD in CentOS on a virtual machine with no problems.

Cheers,

Steve

From: weaselskinghenry @.> Sent: Thursday, September 23, 2021 1:33 PM To: rice-solar-physics/HYDRAD @.> Cc: Subscribed @.***> Subject: Re: [rice-solar-physics/HYDRAD] GCC version issues on Linux CentOS (#93)

Can you clarify what you mean by HYDRAD setup? I cloned a copy from Github in April, if that helps!

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rice-solar-physics/HYDRAD/issues/93#issuecomment-926057154 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ACC6C7S4QIXD5OGJT5USGJLUDNXELANCNFSM5ETZIROA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub . https://github.com/notifications/beacon/ACC6C7VDVLQG6CMGPFRN2YDUDNXELA5CNFSM5ETZIROKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOG4ZIFQQ.gif

weaselskinghenry commented 2 years ago

Hi Steve, I did that and got exactly the same error. Also, the new version doesn't include HYDRAD.bat? I copied it over from my old version, I run it in command line rather than through the GUI.

jwreep commented 2 years ago

After you compile HYDRAD, are there two files in /HYDRAD/config/ ? As Will mentioned, filenames can have case sensitivity issues on different operating systems. There might be a file name HYDRAD.cfg and one named hydrad.cfg, and the code might segfault when this happens if it reads the wrong one.