Hi Vincent:
It sounds from your remarks below that you are making good progress. More
below in context.
On 2019-03-04 10:16+0100 Vincent MAGNIN wrote:
Hi Alan and Ole,
thank you for your answers. Understanding a problem is half the solution.
This is the report of my last efforts:
1) I have uninstalled and purged from my Debian Sid virtual machine all the
PLplot packages:
# apt remove libplplot-dev plplot-doc plplot-tcl-dev octave-plplot
python3-plplot-qt
# apt autoremove
# apt purge libplplot-dev plplot-doc plplot-tcl-dev octave-plplot
python3-plplot-qt libplplot-lua libplplot-ocaml plplot-tcl plplot-tcl-bin
2) I have downloaded PLplot 5.14.0 from SourceForge, built it and installed
it (see attached files):
$ mkdir build_pl && cd build_pl
$ cmake ../plplot-5.14.0 >& cmake.out
$ make VERBOSE=1 >& make.out
$ make VERBOSE=1 install >& make_install.out
$ sudo make VERBOSE=1 install >& make_install.out
This is just a comment in passing about the installation prefix you
have chosen by default here. Instead, I suggest you specify the cmake
option -DCMAKE_INSTALL_PREFIX=<whatever install prefix you like>. The
prefix you chose instead by default was /usr/local. That is under
control by the root account which is why you had to install as root.
But if you use a unique install prefix under user account control
instead, you don't have to install as the root account, and removing
that entire prefix directory again for further installation tries is
so easy compared to removing all the PLplot bits and pieces in
/usr/local.
3) I have built the Fortran examples and tested successfully some of them:
$ cd /usr/local/share/plplot5.14.0/examples/fortran/
$ sudo make
$ ./x08f
Plotting Options:
< 1> xwin X-Window (Xlib)
< 8> xcairo Cairo X Windows Driver
The examples work fine (I don't know why this time I have no problem
concerning the X server).
Excellent!
4) But now when I build the gtk-fortran project (gtk2devel branch), CMake
does not find anymore PLplot:
osboxes@osboxes:~/gtk-fortran/build$ cmake -D CMAKE_BUILD_TYPE=debug ..
-- The Fortran compiler identification is GNU 8.3.0
-- Check for working Fortran compiler: /usr/bin/f95
-- Check for working Fortran compiler: /usr/bin/f95 -- works
-- Detecting Fortran compiler ABI info
-- Detecting Fortran compiler ABI info - done
-- Checking whether /usr/bin/f95 supports Fortran 90
-- Checking whether /usr/bin/f95 supports Fortran 90 -- yes
-- Compiler: GNU 8.3.0 /usr/bin/f95
-- Build type is: debug
-- Compilation flags: -g -pthread -Wall -pedantic -std=f2008 -Wtabs
-fcheck=all -fbacktrace -Wno-unused-dummy-argument
-- Found GTK2_GTK: /usr/lib/x86_64-linux-gnu/libgtk-x11-2.0.so
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- PLPLOT not found: PLPLOT integration and examples will not be built
-- Configuring done
-- Generating done
-- Build files have been written to: /home/osboxes/gtk-fortran/build
find_package(plplot) (which you use below) just works for me here when
I use it to build the installed examples that are linked with the
installed PLplot libraries. Did you forget to set the environment
variable CMAKE_PREFIX_PATH to your PLplot prefix (/usr/local for now,
see above) so that the installed version of PLplot can be found?
This is the part of the main CMakeLists.txt where we are looking for PLplot:
# PLplot
if (NOT EXCLUDE_PLPLOT)
# find_package(PlplotF95 QUIET)
find_package(plplot)
set(HAVE_LIBPLPLOTF95D ${PLPLOT_FOUND})
if(PLPLOT_FOUND)
set(LIBRARIES ${LIBRARIES} ${PLPLOT_LIBRARIES})
include_directories(${PLPLOT_INCLUDE_DIR})
include_directories(${PLPLOT_MODULE_DIR})
set(CMAKE_REQUIRED_LIBRARIES "${PLPLOT_LIBRARIES}")
set(CMAKE_REQUIRED_INCLUDES "${PLPLOT_INCLUDE_DIR};
${PLPLOT_MODULE_DIR}")
check_fortran_source_compiles("
program tw
use plplot
implicit none
real(kind=plflt) :: w = 0.5_plflt
call plinit()
call plwidth(w)
end program tw" NEW_PLPLOT
)
check_fortran_source_compiles("
program tdef
use plplot
implicit none
integer :: i = PLESC_DEVINIT
end program tdef" NEW_PLPLOT_DEFS
)
else(PLPLOT_FOUND)
message(STATUS "PLPLOT not found: PLPLOT integration and examples will
not be built")
endif(PLPLOT_FOUND)
else(NOT EXCLUDE_PLPLOT)
message(STATUS "PLPLOT Excluded as command option")
endif(NOT EXCLUDE_PLPLOT)
Once you have found the installed PLplot (see comment above), I am not
sure the above method will work anymore. Instead, I suggest you
follow the CMake logic (for the case when CORE_BUILD is false) in
$PLPLOT_PREFIX/share/plplot5.14.0/examples/CMakeLists.txt (our
principal CMakeLists.txt file for the installed examples);
$PLPLOT_PREFIX/share/plplot5.14.0/examples/cmake/modules/plplot_configure.cmake
(a configured file that contains definitions for many useful CMake
variables); and primarily
$PLPLOT_PREFIX/share/plplot5.14.0/examples/fortran/CMakeLists.txt
(which is used to build our fortran examples that are linked against
the installed PLplot) to build your Fortran source against PLplot.
Of course, if you have any trouble following the CMake logic in the above 3
files,
please ask again here.
Alan
__________________________
Alan W. Irwin
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general