kazuakiyama / homebrew-sched

Homebrew formula for the NRAO's SCHED package
2 stars 0 forks source link

insatallation error on M3 machine - is it related to fortran compiler? #1

Closed jameskleung closed 1 month ago

jameskleung commented 1 month ago
brew install sched ==> Fetching kazuakiyama/sched/sched ==> Downloading ftp://ftp.aoc.nrao.edu/pub/sched/sched_11.8/sched_11.8.tar.gz ##################################################################################################################################################### 100.0% ==> Installing sched from kazuakiyama/sched ==> Using Homebrew-provided Fortran compiler This may be changed by setting the FC environment variable. ==> cd src; make FC='gfortran -Darm_osx -Wall -fimplicit-none -fno-backslash -fallow-argument-mismatch' LPGPLOT=/opt/homebrew/lib LDPGPLOT='-L/opt/homebrew/ Last 15 lines from /Users/user/Library/Logs/Homebrew/sched/01.lib: gfortran -Darm_osx -Wall -fimplicit-none -fno-backslash -fallow-argument-mismatch -c -o Cit/sys_linux/error.o Cit/sys_linux/error.f gfortran -Darm_osx -Wall -fimplicit-none -fno-backslash -fallow-argument-mismatch -c -o Cit/sys_linux/vlbope.o Cit/sys_linux/vlbope.f gcc-14 -c -o Cit/sys_linux/exit.o Cit/sys_linux/exit.c Cit/syslinux/exit.c: In function 'exit': Cit/sys_linux/exit.c:7:8: error: passing argument 1 of 'exit' makes integer from pointer without a cast [-Wint-conversion] 7 exit(errno); ^~~~~
int *

In file included from Cit/sys_linux/exit.c:3: /Library/Developer/CommandLineTools/SDKs/MacOSX14.sdk/usr/include/stdlib.h:145:15: note: expected 'int' but argument is of type 'int *' 145 | void exit(int) __dead2; | ^~~ make[1]: [Cit/sys_linux/exit.o] Error 1 make: [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/homebrew-core): https://github.com/kazuakiyama/homebrew-sched/issues

kazuakiyama commented 1 month ago

Hi, thanks for the issue. I will look into this next few days.

kazuakiyama commented 1 month ago

I just got a M3 macOS machine and could replicate this issue. This is not an issue with fortran but SCHED's C code. Cit/sys_linux/exit.o Cit/sys_linux/exit.c is a simple C code as below.

/* Wrapper function for exit */
/* by kaj.wiik@hut.fi (25 May 1996) */
#include <stdlib.h>

void exit_ (int *errno) {

  exit(errno);

}

I think the latest Xcode's stdlib.h anticipate that exit function will take only an integer rather than the pointer. This causes an error here. In the mean time, I will ignore this compile error by specifying "-Wno-int-conversion" option for GCC. But, this just allows to compile sched without an error and doesn't guarantee that the compiled software will work without an issue by that. Ultimately this needs to be fixed by the SCHED developer team.

@jameskleung if you don't mind, would you volunteer to create an issue at the NRAO website to report this issue? Please feel free to link this issue page. Here is the link to the page. https://science.nrao.edu/observing/helpdesk

kazuakiyama commented 1 month ago

Hi I just made the above adhoc fix that at least allows to compile SCHED without an error. Please try brew update; brew install sched, and also let me know if it doesn't work or you have any issues with the compiled software. As I said this particular issue needs to be fixed by the SCHED developer team.

jameskleung commented 1 month ago

Thanks Kazu, I have submitted a helpdesk ticket and will let you know how it goes. Meanwhile, the work around works well and I have not run into any problems while using it.

kazuakiyama commented 1 month ago

Great! Thanks for confirming this so quickly! I will close the issue. Please feel free to reopen if you find any issues.