HomerReid / scuff-em

A comprehensive and full-featured computational physics suite for boundary-element analysis of electromagnetic scattering, fluctuation-induced phenomena (Casimir forces and radiative heat transfer), nanophotonics, RF device engineering, electrostatics, and more. Includes a core library with C++ and python APIs as well as many command-line applications.
http://www.homerreid.com/scuff-em
GNU General Public License v2.0
125 stars 50 forks source link

Quick Questions about scuff-cas3D #206

Closed xygao96 closed 4 years ago

xygao96 commented 4 years ago

Hi Homer,

I am a beginner of using scuff-em to calculate Casimir Force. Yesterday I tested the command scuff-cas3D with the example SiliconBeams. However I found it was much more time consuming than I expected, and there are something I did not quite understand when I used 'tail' command to track the progress of calculation.

When I run the scuff-cas3D with at single frequency with command --Xi. It seems that every it complete one round calculation from transform 1.0 to transform 5.0, it will go back to transform 1.0 to calculate again. But it does not clearly show other information about the calculation. So I am confused why it will go back again and again to calculation many time for one frequency? And how long will it take to complete a calculation at specific frequency or a full fun?

Thank you, Xingyu

xygao96 commented 4 years ago

And I also met another problem when I tried to install scuff-em on clusters which uses CentOS system. As this cluster is owned by the university, I do not have the privileges to use sudo to install package. So I installed all the required package like OpenBLAS by compiling from source. However when I run the 'sh autogen.sh' command, it always shows an error: configure: error: BLAS not found!

I tried to fix the problem by adding the bin/lib path of OpenBLAS to .bashrc file, but this problem still existed.

I don't know I happens as I already installed the OpenBLAS package.

texnokrates commented 4 years ago

I tried to fix the problem by adding the bin/lib path of OpenBLAS to .bashrc file, but this problem still existed.

Could you be more specific on what exactly did you put there? You should check that you really have set the environment variables correctly (e.g. running env).

xygao96 commented 4 years ago

I tried to fix the problem by adding the bin/lib path of OpenBLAS to .bashrc file, but this problem still existed.

Could you be more specific on what exactly did you put there? You should check that you really have set the environment variables correctly (e.g. running env).

I wrote: export PATH=/home/gao477/OpenBLAS/bin:$PATH export LD_LIBRARY_PATH=/home/gao477/OpenBLAS/lib:$LD_LIBRARY_PATH to the ~/.bashrc file. And after using 'source ~/.bashrc', the 'env' command shows that:

LD_LIBRARY_PATH=/home/gao477/scheme/lib:/home/gao477/ncurse/lib:/home/gao477/OpenBLAS/lib:/apps/cent7/intel/impi/2017.1.132/lib64:/apps/cent7/intel/itac/2017.1.024/intel64/slib:/apps/cent7/intel/itac/2017.1.024/lib:/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64:/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/ipp/lib/intel64:/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/mkl/lib/intel64:/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/tbb/lib/intel64/gcc4.7:/apps/cent7/intel/opencl-1.2-sdk-6.3.0.1904/lib64:/opt/thinlinc/lib64:/opt/thinlinc/lib

PATH=/home/gao477/scheme/bin:/home/gao477/ncurse/bin:/home/gao477/OpenBLAS/bin:/opt/moab/bin:/usr/lib64/qt-3.3/bin:/apps/cent7/xalt/bin:/apps/cent7/intel/impi/2017.1.132/bin64:/apps/cent7/intel/itac/2017.1.024/bin:/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/bin/intel64:/apps/cent7/intel/inspector_2017.1.1.484836/bin64:/apps/cent7/intel/advisor_2017.1.1.486553/bin64:/apps/cent7/intel/vtune_amplifier_xe_2017/bin64:/apps/cent7/intel/opencl-1.2-sdk-6.3.0.1904/bin:/opt/moab/bin:/bin:/usr/bin:/opt/thinlinc/bin:/usr/local/bin:/usr/bin/X11:/sbin:/usr/sbin:/usr/local/sbin:/opt/hpss/bin:/opt/hsi/bin:/opt/ibutils/bin:/opt/moab/bin:/opt/hpss/bin:/opt/hsi/bin:/opt/moab/bin

And I also used

sh autogen.sh --prefix=/home/gao477/packages/scuff-em -v LIBS=-ldl LDFLAGS="-L/home/gao477/OpenBLAS/lib -L/home/gao477/Downloads/hdf5-1.10.5/hdf5/lib -L/usr/local/lib" CPPFLAGS="-I/home/gao477/OpenBLAS/include -I/usr/local/include -I/home/gao477/Downloads/hdf5-1.10.5/hdf5/include"

when I run sh autogen.sh . With these options, hdf5 can be found, but OpenBLAS still cannot be found. But this afternoon I tried to install MPB package which also requires OpenBLAS. Without -L/home/gao477/OpenBLAS/lib and -I/home/gao477/OpenBLAS/include, MPB also showed an error of BLAS not found. After adding these two options, it was installed successfully.

xygao96 commented 4 years ago

autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --force libtoolize: putting auxiliary files in.'. libtoolize: linking file ./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'. libtoolize: linking file m4/libtool.m4' libtoolize: linking filem4/ltoptions.m4' libtoolize: linking file m4/ltsugar.m4' libtoolize: linking filem4/ltversion.m4' libtoolize: linking file m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --force-missing autoreconf: Leaving directory.' autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --force libtoolize: putting auxiliary files in.'. libtoolize: linking file ./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'. libtoolize: linking file m4/libtool.m4' libtoolize: linking filem4/ltoptions.m4' libtoolize: linking file m4/ltsugar.m4' libtoolize: linking filem4/ltversion.m4' libtoolize: linking file m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --force-missing autoreconf: Leaving directory.' autoreconf: Entering directory .' autoreconf: configure.ac: not using Gettext autoreconf: running: aclocal --force -I m4 autoreconf: configure.ac: tracing autoreconf: running: libtoolize --force libtoolize: putting auxiliary files in.'. libtoolize: linking file ./ltmain.sh' libtoolize: putting macros in AC_CONFIG_MACRO_DIR,m4'. libtoolize: linking file m4/libtool.m4' libtoolize: linking filem4/ltoptions.m4' libtoolize: linking file m4/ltsugar.m4' libtoolize: linking filem4/ltversion.m4' libtoolize: linking file m4/lt~obsolete.m4' autoreconf: running: /usr/bin/autoconf --force autoreconf: running: /usr/bin/autoheader --force autoreconf: running: automake --add-missing --force-missing autoreconf: Leaving directory.' checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking whether make supports nested variables... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking how to print strings... printf checking for style of include used by make... GNU checking for gcc... mpiicc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether mpiicc accepts -g... yes checking for mpiicc option to accept ISO C89... none needed checking dependency style of mpiicc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking for ld used by mpiicc... /apps/cent7/xalt/bin/ld checking if the linker (/apps/cent7/xalt/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B checking the name lister (/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 3458764513820540925 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /apps/cent7/xalt/bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... no checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /bin/nm -B output from mpiicc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... mpiicc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if mpiicc supports -fno-rtti -fno-exceptions... yes checking for mpiicc option to produce PIC... -fPIC -DPIC checking if mpiicc PIC flag -fPIC -DPIC works... yes checking if mpiicc static flag -static works... no checking if mpiicc supports -c -o file.o... yes checking if mpiicc supports -c -o file.o... (cached) yes checking whether the mpiicc linker (/apps/cent7/xalt/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking whether to enable maintainer-specific portions of Makefiles... yes checking whether we are using the GNU C++ compiler... yes checking whether mpiicpc accepts -g... yes checking dependency style of mpiicpc... gcc3 checking how to run the C++ preprocessor... mpiicpc -E checking for ld used by mpiicpc... /apps/cent7/xalt/bin/ld -m elf_x86_64 checking if the linker (/apps/cent7/xalt/bin/ld -m elf_x86_64) is GNU ld... yes checking whether the mpiicpc linker (/apps/cent7/xalt/bin/ld -m elf_x86_64) supports shared libraries... yes checking for mpiicpc option to produce PIC... -fPIC -DPIC checking if mpiicpc PIC flag -fPIC -DPIC works... yes checking if mpiicpc static flag -static works... no checking if mpiicpc supports -c -o file.o... yes checking if mpiicpc supports -c -o file.o... (cached) yes checking whether the mpiicpc linker (/apps/cent7/xalt/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking for g77... no checking for xlf... no checking for f77... no checking for frt... no checking for pgf77... no checking for cf77... no checking for fort77... no checking for fl32... no checking for af77... no checking for xlf90... no checking for f90... no checking for pgf90... no checking for pghpf... no checking for epcf90... no checking for gfortran... gfortran checking whether we are using the GNU Fortran 77 compiler... yes checking whether gfortran accepts -g... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking for gfortran option to produce PIC... -fPIC checking if gfortran PIC flag -fPIC works... yes checking if gfortran static flag -static works... no checking if gfortran supports -c -o file.o... yes checking if gfortran supports -c -o file.o... (cached) yes checking whether the gfortran linker (/apps/cent7/xalt/bin/ld -m elf_x86_64) supports shared libraries... yes checking dynamic linker characteristics... (cached) GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking how to get verbose linking output from gfortran... -v checking for Fortran 77 libraries of gfortran... -L/home/gao477/Downloads/hdf5-1.10.5/hdf5/lib -L/home/gao477/OpenBLAS/lib -L/usr/local/lib -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/compiler/lib/intel64 -L/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/ipp/lib/intel64 -L/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/mkl/lib/intel64 -L/apps/cent7/intel/compilers_and_libraries_2017.1.132/linux/tbb/lib/intel64/gcc4.7 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../.. -ldl -lgfortran -lm -lquadmath checking for dummy main to link with Fortran 77 libraries... none checking for Fortran 77 name-mangling scheme... lower case, underscore, no extra underscore checking for OpenMP flag of C++ compiler... -fopenmp checking for the pthreads library -lpthreads... no checking whether pthreads work without any flags... yes checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE checking if more special flags are required for pthreads... no checking for PTHREAD_PRIO_INHERIT... yes checking hdf5.h usability... yes checking hdf5.h presence... yes checking for hdf5.h... yes checking for H5Fcreate in -lhdf5... yes checking for H5LTmake_dataset_double in -lhdf5hl... yes checking for sgemm... no checking for ATLxerbla in -latlas... no checking for sgemm in -lblas... no checking for sgemm in -lmkl... no checking for sgemm... (cached) no checking for sgemm in -lcxml... no checking for sgemm in -ldxml... no checking for sgemm in -lscs... no checking for sgemm in -lcomplib.sgimath... no checking for sgemm in -lblas... (cached) no checking for sgemm in -lblas... (cached) no configure: error: BLAS was not found!

texnokrates commented 4 years ago

LD_LIBRARY_PATH defines where the libraries should be looked for at runtime, but that's the least useful information for the installation script. It needs to know where they are located during installation and mainly where the header files are located. So you need to set also LIBRARY_PATH and C_INCLUDE_PATH, roughly like this:

export LIBRARY_PATH=/home/gao477/OpenBLAS/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=/home/gao477/OpenBLAS/include:$C_INCLUDE_PATH

(Don't copy that blindly, check whether the files really exist under the given paths.)

xygao96 commented 4 years ago

LD_LIBRARY_PATH defines where the libraries should be looked for at runtime, but that's the least useful information for the installation script. It needs to know where they are located during installation and mainly where the header files are located. So you need to set also LIBRARY_PATH and C_INCLUDE_PATH, roughly like this:

export LIBRARY_PATH=/home/gao477/OpenBLAS/lib:$LIBRARY_PATH
export C_INCLUDE_PATH=/home/gao477/OpenBLAS/include:$C_INCLUDE_PATH

(Don't copy that blindly, check whether the files really exist under the given paths.)

I am sorry that it still doesn't work and problem is still the same. I check the content in /OpenBLAS/lib and the files are:

cmake libopenblas_haswellp-r0.3.7.dev.a libopenblas.so pkgconfig libopenblas.a libopenblas_haswellp-r0.3.7.dev.so libopenblas.so.0

And in the directory /OpenBLAS/include, the files are:

cblas.h lapacke_config.h lapacke_mangling.h openblas_config.h f77blas.h lapacke.h lapacke_utils.h

I don't know whether it is right for OpenBLAS package.

xygao96 commented 4 years ago

I asked the similar question at the github of OpenBLAS and they told me: "If you look at the error message carefully, it says BLAS was not found. It doesn't look for openblas at all. You should talk with the downstream projects about openblas support. (Or make a symlink libblas.so -> libopenblas.so)"

I am not very clear about the last sentence as I never used symlink before. So I tried to create a symlink with the command: ln -s libopenblas.so libblas.so ln -s libopenblas.a libblas.a

But it still did not work. :(

xygao96 commented 4 years ago

The problem is fixed by make some change of the file m4/acx_blas.m4. I added

if test $acx_blas_ok = no; then AC_CHECK_LIB(openblas, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lopenblas"]) fi

to this file. And it now works. And I also link the OpenBLAS to the library: gcc -o test test.c -I /home/gao477/packages/OpenBLAS/include -L/home/gao477/OpenBLAS/lib -lopenblas gcc -o test test.c /home/gao477/packages/OpenBLAS/lib/libopenblas.a -lpthread -lirc

And it now works.