Graphic display of example script

Asked by David Wang on 2020-08-09

Hi Whizard Team,

Thank you for providing this powerful software. I installed whizard through macport. When I run the example script, Z-lineshape.sin. It has one warning:

Warning: Skipping results display because latex/mpost/dvips is not available

I checked that I installed both mpost and dives, but I see no graphical display. I cannot find any reference for this through our manual or online. Do you know what might be the problem?

Question information

Language:
English Edit question
Status:
Solved
For:
WHIZARD Edit question
Assignee:
Juergen Reuter Edit question
Solved by:
David Wang
Solved:
2020-08-10
Last query:
2020-08-10
Last reply:
2020-08-10
Juergen Reuter (j.r.reuter) said : #1

Hi David,
in general the installation via Macports for MAC OS X is not really recommended, as it leaves no freedom to the user to fine-tune the installation process. A general installation is the by far recommended method. For a general installation with a downloaded distribution, a proper configure and make process we can give the necessary support. For the Macports you'd have to look into the build logs of the Macports directory to see why the LaTeX support didn't work.
Best,
    JRR (Juergen Reuter)

David Wang (david-mhw) said : #2

Thank you! I encountered a warning when following the manual.

 1266 | 42 write(*,*)'a(',i,')=',ai(i)
      | 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 42 at (1)
/usr/local/whizard/whizard-2.8.4/src/threshold/toppik.f:1268:72:

 1268 | 100 gamma(ix)= gamma(ix)/nevent
      | 1
Warning: Fortran 2018 deleted feature: DO termination statement which is not END DO or CONTINUE with label 100 at (1)
/usr/local/whizard/whizard-2.8.4/src/threshold/toppik.f:1275:72:

and this warning repeated several times. Does it mean that I had better install earlier version gfortran which is before 2018. I don't know if I need to worry about this issue. Thanks!

Juergen Reuter (j.r.reuter) said : #3

No, you don't need to worry. There are some legacy code parts that ship with WHIZARD, e.g. old Fortran versions of Pythia6, Tauola, and Toppik. These contain code snippets that are deleted features of the Fortran language according to the Fortran 2018 language standard. However, they are not eliminated from any of the different compilers that are supported by WHIZARD, gfortran, nagfor or Intel. It is just a warning of the compiler.

David Wang (david-mhw) said : #4

Thanks for the quick reply! My last question is that what is openmp for? Is openmp only for installing on clusters while mpi is for regular computer? So, if I have a Mac, I only need to enable mpi in the configure for parallel computing?

David Wang (david-mhw) said : #5

Making all in gamelan
make[2]: Nothing to be done for `all'.
Making all in feynmf
make[2]: Nothing to be done for `all'.
  CCLD libwhizard.la
clang: error: unsupported option '-fopenmp'
make[2]: *** [libwhizard.la] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1

Since I am encountering this error about openmp when I install with the following configuration:

sudo /usr/local/whizard/whizard-2.8.4/configure FC=mpifort CC=mpicc CXX=mpic++ --enable-fc-openmp --enable-fc-mpi

I already installed libomp and open-mpi by home-brew.

Thank you!

Juergen Reuter (j.r.reuter) said : #6

It is actually the other way round: OpenMP is for multi-threading, so for using multiple threads on a single multi-core machine (like e.g. a laptop), while MPI is for usage across different nodes like in a cluster. The error message in your last case comes from the fact that you are using gfortran as Fortran compiler, but clang as C compiler and linker. This can work, but very often it does not, as in your case where clang as a linker doesn't understand the gfortran/gcc specific -fopenmp flag. You either have to compile without openmp or you use gcc as underlying C compiler, e.g. setting CC=gcc as additional argument during configuration.

Juergen Reuter (j.r.reuter) said : #7

It is actually the other way round: OpenMP is for multi-threading, so for using multiple threads on a single multi-core machine (like e.g. a laptop), while MPI is for usage across different nodes like in a cluster. The error message in your last case comes from the fact that you are using gfortran as Fortran compiler, but clang as C compiler and linker. This can work, but very often it does not, as in your case where clang as a linker doesn't understand the gfortran/gcc specific -fopenmp flag. You either have to compile without openmp or you use gcc as underlying C compiler, e.g. setting CC=gcc as additional argument during configuration.

David Wang (david-mhw) said : #8

Thank you very much for the explanation! It is very helpful! In fact, I do want to install Whizard-2.8.4 with OpenMP configure. However, the issue still occurs even when I include CC=gcc. I think this might be linker-related issue because when I run:

gcc -fopenmp -o hello hello.c

the clang:error unsupported option '-fopenmp' also occurs. It means that even the gcc linker cannot work. I saw some solutions online referring to use llvm, which contains the following info after installation:

To use the bundled libc++ please add the following LDFLAGS:
  LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"

llvm is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.

If you need to have llvm first in your PATH run:
  echo 'export PATH="/usr/local/opt/llvm/bin:$PATH"' >> ~/.zshrc

For compilers to find llvm you may need to set:
  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

I put the PATH in the terminal file and change the configuration to

sudo /usr/local/whizard/whizard-2.8.4/configure FC=mpifort CC=mpicc CXX=mpic++ LDFLAGS="-L/usr/local/opt/llvm/lib" CPPFLAGS="-I/usr/local/opt/llvm/include" --enable-fc-openmp --enable-fc-mpi

However, the error about clang '-fopenmp' still occurs. I am wondering whether I forget to include certain steps or do something wrong above. Maybe put two export statements:

  export LDFLAGS="-L/usr/local/opt/llvm/lib"
  export CPPFLAGS="-I/usr/local/opt/llvm/include"

 in the Makefile in the source package of Whizard-2.8.4?

Juergen Reuter (j.r.reuter) said : #9

Actually, clang should understand -fopenmp according to a check on my system:
clang --help
  -fopenmp Parse OpenMP pragmas and generate parallel code.
On the other hand, I tried your example and the error message I get is
clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
Ineed this looks like an Apple bug.
I think some of the problems arise that there is probably a clang that is installed
via Homebrew and that is not the native Apple clang, but the final linking happens
via this linking. I installed gcc/gfortran/g++ by myself in /usr/local.
Be careful, there is a symbolic link for gcc towards clang on MAC OS X, be sure that
you use the GNU gcc for linking.

David Wang (david-mhw) said : #10

Oh, I see. Thank you! I checked that my clang also have -fopenmp function.

Yeah, when I check my /usr/local/bin, I do find sth interesting. Since I use brew install gcc, there is a link called gcc-10, while in the /usr/bin, there is a link called gcc. So, I guess when the system tries to build whizard, it finds the default one first, which is the gcc (Just to make sure I get your last sentence correctly, this gcc is linked toward clang on Mac OS X), then I have the issue.

However, when I configure it, Whizard does find the correct gfortran-10.

Now, I think that I should try to install it without extra configure. So, I just use configure this time. But even I did not enable mpi, the system shows this error:

39 | use mpi_f08 !NODEP!
      | 1
Fatal Error: Cannot open module file 'mpi_f08.mod' for reading at (1): No such file or directory

Juergen Reuter (j.r.reuter) said : #11

The fact that you see this error message even for a configure without the mpi flag is probably a leftover from an unclean build. Make sure to erase the build folder properly, if you make a fundamental change in the build setup like MPI vs. no serial build.
Normally, the MPI wrapper (mpifort) takes care of the correct paths. I think, on the laptop you should focus to make a serial build first.

David Wang (david-mhw) said : #12

 I totally agree with you that I should focus on a serial build. Fortunately, I have my build folder separated from my source file. Do you know how to properly clean the build file in this case? I used sudo make clean before I configure but it seems not doing the job. Should I just delete the whole build file since it is separated from the source file? Thank you!

Juergen Reuter (j.r.reuter) said : #13

Yes, just erase the whole folder, and use a fresh one.

David Wang (david-mhw) said : #14

Thank you very much for your patience! I finally got it working. I will try to twig around later for the parallel version since the macport version is a parallel one and it is much faster. But, the graphics works good now!