Troubleshooting ACC Code Issues
On this page we will document some of the most common and most often issues seen while attempting to build and run ACC Code.
We will constantly be adding to this page, when you see an issue when building or running ACC Code, please send email to the ACC Code Librarian
Xcode 11 BUG ALERT (06-May-2020)
- Due to a bug in Xcode 11, building the Bmad Distribution on macOS 10.14 Mojave will fail - Please do not upgrade to Xcode 11 with macOS 10.14 Mojave.
Got "ld: library not found for -lSystem" error on Mac
This is is due to an incompatibility problem between Xcode and the Mac operating system. See:
Got "WARNING - no compatible fortran compiler found" message
The symtom is when util/dist_prefs is run when Bmad is initialized, the following error is generated:
WARNING - no compatible fortran compiler found, unable to build the Bmad Distribution.
Please install GNU GCC/gfortran version 5.3, or later
or set your PATH to where a minimum GNU GCC/gfortran version of 5.3 is located.
First check that gcc is installed using the command
> gcc --version
If a valid gcc version is installed, check that gfortran is installed
> gfortran --version
If everything looks OK, contact a Bmad maintainer
PGPLOT's pgxwin_server Not Found
The symptom is that running a program (EG: Tao) that uses the PGPLOT plotting package results in the error:
PGPLOT /xw: Couldn't find program "pgxwin_server" in the directory named
PGPLOT /xw: in your PGPLOT_DIR environment variable, or in any directory
PGPLOT /xw: listed in your PATH environment variable.
The problem may be there was a problem with compiling PGPLOT. To diagnose, try recompiling PGPLOT. To do this, go to the PGPLOT directory and issue the commands
If you see an error that, for example, the headerfile called X11/intrinsic.h is missing, the solution is to install the header file and recompile PGPLOT.
All Programs Bomb
If all programs are bombing with a similar error message like:
Program received signal SIGSEGV: Segmentation fault - invalid memory reference.
Backtrace for this error:
#0 0x7fba69e9b2da in ???
#1 0x7fba69e9a503 in ???
#2 0x7fba694fef1f in ???
#3 0x7fffe95bc8f4 in ???
Segmentation fault (core dumped)
The problem could be that the ulimit
setup has not been done. Ulimit setup instructions for offsite running are at here
The way to diagnose this problem is to use the command:
And comparing the actual limits with what should be set
Fatal Error Compiling lapack with Mac 10.14 (Mojave)
If you see the following error compiling lapack with Mac 10.14 (Mojave):
../include/lapacke.h:44:10: fatal error: stdlib.h: No such file or directory
Program is Slow
Running a profile
will show where in the code a program is taking the most time
Distribution compile time errors
When running the
util/dist_build_debug scripts, a failure mode occurs when one or more compile tools(automake, libtool, etc.) are missing and xraylib does not build. The script will continue and finally the build will terminate with an error like:
/bmad_dist/bmad/photon/xraylib_interface.f90:36.4: use xraylib, dummy => r_e 1 Fatal *Error: Can't open module file 'xraylib.mod'* for reading at (1): No such file or directory gmake: *** [CMakeFiles/bmad.dir/photon/xraylib_interface.f90.o] Error 1 gmake: *** [CMakeFiles/bmad.dir/photon/xraylib_interface.f90.o.provides] Error 2 gmake: *** Waiting for unfinished jobs.... gmake: *** [CMakeFiles/bmad.dir/all] Error 2 gmake: *** [all] Error 2
- Solution: cd to the xraylib directory and issue the command mk . The output after this command should show you what compile tools are missing. Then use the appropriate system commands to install them.
"Undefined Reference to" Link Errors:
An "undefined reference to " error can be generated if the compiler used for compiling and linking the program is different from the compiler used to build the libraries that the program needs to link to (the libraries linked to are listed in the LINK_LIBS statement in the cmake.XXX file). The error would look something like:
Linking C executable /home/dcs16/linux_lib/debug/bin/newin /usr/bin/cmake28 -E cmake_link_script CMakeFiles/newin-exe.dir/link.txt --verbose=Y gmake: Entering directory `/nfs/acc/user/dcs16/linux_lib/test_peck/debug' gmake: Nothing to be done for `CMakeFiles/newin.dir/build'. gmake: Leaving directory `/nfs/acc/user/dcs16/linux_lib/test_peck/debug' /usr/bin/cmake28 -E cmake_progress_report /home/dcs16/linux_lib/test_peck/debug/CMakeFiles 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 /opt/rh/devtoolset-3/root/usr/bin/cc -g CMakeFiles/newin-exe.dir/code/newin.c.o -o /home/dcs16/linux_lib/debug/bin/newin -L/home/dcs16/linux_lib/test_peck/../debug/lib -L/nfs/acc/libs/Linux_x86_64_intel/devel/packages/debug/lib -L/nfs/acc/libs/Linux_x86_64_intel/devel/debug/lib -L/nfs/acc/libs/Linux_x86_64_intel/devel/packages/debug/lib/root -rdynamic -Wl,-Bstatic -lgenplt ../../debug/lib/libmpm_utils.a -lmpmnet ../../debug/lib/libcesr_utils.a ../../debug/lib/libsim_utils.a -lc_utils -Wl,-Bdynamic -lcurses -lMrm -lXm -lXt -lSM -lICE -lX11 -lXext -lreadline -ltermcap -lcurses -lpthread -lstdc++ -lactivemq-cpp -Wl,-Map=/home/dcs16/linux_lib/test_peck/../debug/map/newin.map -Wl,-rpath,/home/dcs16/linux_lib/test_peck/../debug/lib:/nfs/acc/libs/Linux_x86_64_intel/devel/packages/debug/lib:/nfs/acc/libs/Linux_x86_64_intel/devel/debug/lib:/nfs/acc/libs/Linux_x86_64_intel/devel/packages/debug/lib/root [ 97%] Built target newin /nfs/acc/libs/Linux_x86_64_intel/devel/debug/lib/libgenplt.a(gg_flush_ps.f90.o): In function `gg_flush_ps': /nfs/acc/libs/Linux_x86_64_intel/cesr_2015_0127_d/genplt/gg/gg_flush_ps.f90:7: *undefined reference to `for_write_seq_fmt'* /nfs/acc/libs/Linux_x86_64_intel/cesr_2015_0127_d/genplt/gg/gg_flush_ps.f90:7: *undefined reference to `for_write_seq_fmt_xmit'*
In this case, the compiler mismatch is diagnosed by realizing that the undefined references refer to modules are associated with the compiler. For example, looking at the above printout, and doing a Google search, shows that for_write_seq_fmt is part of the ifort compiler library.
- Solution: The mismatch can come about when linking modules compiled from code written in different languages. Add set(IMPLICIT_LINK_LIBS <lang> ) to the cmake PROJECT file and replace <lang> with the language used to build the libraries in the LINK_LIBS statement.
An "undefined reference to " error can be generated if the two xraylib
. are not in the correct order in the LINK_LIBS statement in the cmake.XXX file. The error would look something like:
Linking Fortran executable /home/dcs16/linux_lib/production/bin/spin1
/nfs/acc/libs/Linux_x86_64_intel/devel/packages/production/lib/libxrlf03.a(libxrlf03_la-xraylib_wrap.o): In function `xraylib_mp_compoundparser_':
xraylib_wrap.F90:(.text+0x2cd): undefined reference to `CompoundParser'
/nfs/acc/libs/Linux_x86_64_intel/devel/packages/production/lib/libxrlf03.a(libxrlf03_la-xraylib_wrap.o): In function `xraylib_mp_freecompounddata_':
xraylib_wrap.F90:(.text+0x636): undefined reference to `xrlFree'
xraylib_wrap.F90:(.text+0x667): undefined reference to `xrlFree'
- Solution: Reorder the libraries in the cmake.XXX file.
Problem Building XRAYLIB
Symptom error message:
configure.ac:45: error: possibly undefined macro: AC_PROG_LIBTOOL
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
configure: WARNING: unrecognized options: --disable-libtool-lock
configure: error: cannot find install-sh, install.sh, or shtool in build-aux "."/build-aux
- Solution: Upgrade automake. Version 1.14 is known to fail.
PLPLOT Compile Error on MAC
Symptom error message
ld: unexpected token: !tapi-tbd-v3 file '/System/Library/Frameworks//CoreFoundation.framework/CoreFoundation.tbd' for architecture x86_64 collect2: error: ld returned 1 exit status
sudo port install ld64 +ld64_xcode
If you need to contact someone for help, please see the Help and Mailing List Information