MCNPX on MacOSX (tested on PPC 10.4.7 with gcc 4.0.1) ------------------------------ STEP 1, INSTALL a F90 COMPILER ------------------------------ Get a f90 compiler, for example g95,available from www.g95.org. Follow the instructions and make a symbolic link of the binary in a directory, for example /usr/local/bin/, included in your environmental variable $PATH, > sudo ln -sf /directory/g95-install/bin/powerpc-apple-darwin6.8- g95 /usr/local/bin/g95 --------------------- STEP 2, COMPILE MCNPX ---------------------- The following assumes that you have made a directory /mcnpx_26b/ containing the source code tree 'v26b.tar.gz' and the data files 'DATA.tar.gz', and that you will install mcnpx in a new directory /mcnpx_26b/mcnpx. > tar -zxvf v26b.tar.gz > cd v26b You need to replace the 'config.guess' and 'config.sub' with something more recent including macosx. These files are availabe on macosx in /usr/share/automake-1.6/. Replace the config files: > find . -name "config.guess" -print -exec cp /usr/share/ automake-1.6/config.guess {} \; > find . -name "config.sub" -print -exec cp /usr/share/ automake-1.6/config.sub {} \; Now make the install directory and start configuration: > mkdir mcnpx > cd mcnpx > ../v26b/configure \ --with-CC='/usr/bin/gcc' \ --with-CFLAGS='-DUNIX=1 -DLINUX=1' \ --with-FC='g95' \ --with-FFLAGS='-DUNIX=1 -DLINUX=1 -DG95=1 -fsloppy-char' \ --with-LDFLAGS='-Wl,-m' \ --prefix='/mcnpx_26b/mcnpx' The fortran option '-fsloppy-char' is needed for an integer/character issue at runtime. The LDFLAGS '-Wl,-m' is necessary to ignore multiple definitions of the symbol _etime_. The link commands in the generated makefiles include '-lcrt1.o' which should not be there. Remove all occurances of '-lcrt1.o': > find . -name "Makefile.h" -print -exec sed -i -e "s/-lcrt1.o// g" {} \; and compile everything: > make install This will generate the executables in /mcnpx_26b/mcnpx/bin/ ------------------------- STEP 3, GET MCNPX RUNNING ------------------------- You need to complete the installation with the data libraries in a directory given by the environmental variable $DATAPATH or in the default directory /mcnpx_26b/mcnpx/lib/. In this directory should be a file with the name 'xsdir'. Expand the file 'DATA.tar.gz' from the distribution in the directory /mcnpx_26b/: > cd ../ > tar -zxvf DATA.tar.gz Move the files to the directory /mcnpx_26b/mcnpx/lib/ > mv DATA/* mcnpx/lib/ Copy the file 'xsdir1' to 'xsdir' > cp mcnpx/lib/xsdir1 mcnpx/lib/xsdir The installation is ready. Put the path to your mcnpx executable in your $PATH and run some test problems.