Topic: Using DISLIN with SF in MacOS
FULL INSTRUCTIONS FOR MacOS
If I find any errors, or anything to add, I'll try to remember to
keep this as a self-contained set of instructions, by always repeating the FULL SET of instructions in any further posts, with the amendments included.
I invite anyone else to make corrections/improvements in the same way.
Make the Simply Fortran version of gfortran etc
accessible as terminal commands
Add this line to the $HOME/.profile file:
PATH=${PATH}:"/Applications/Simply Fortran.app/Contents/MacOS/"
As explained in the Dislin README file
Install OpenMotif in .Applications.
In Applications/OpenMotif21/lib,
create the symbolic link libXm.dylib to libXm.3.1.dylib:
ln -s /Applications/OpenMotif21/lib/libXm.3.1.dylib /Applications/OpenMotif21/lib/libXm.dylib
Install Dislin in $HOME/{rest-of-your-chosen-pathname}/dislin,
Enter these instructions in the $HOME/.profile file:
DISLIN={dislin directory path]
export DISLIN
PATH=${PATH}:${DISLIN}/bin
DYLD_LIBRARY_PATH=$DISLIN:$DYLD_LIBRARY_PATH
export DYLD_LIBRARY_PATH
Re-compile the applicable dislin.mod file
with SF’s current version of gfortran
cd {pathname to}/dislin/gf/
gfortran -c -o dislin.o dislin.f90
Use these settings in Simply Fortran project options
General:
Target name: /Applications/{Program-name}.app
Code generation:
Target cpu: Generic
Memory model: Default(small)
Compiler flags:
Linker:
-L/Users/John/DEV/dislin -ldislin -L/Applications/OpenMotif21/lib -lXm
File locations :
Modules/Include files: {path to}dislin/gf
Libraries : {path to}/dislin
Additional step needed to resolve runtime errors
With successfully compiled and linked executables
these runtime errors may occur:
Dyld: Library not loaded: /usr/local/lib/libdislin.11.dylib.
Referenced from: /users/John/DEV/InStruct/Mac.SF/InStruct64
and/or
Warning: Widget must be a VendorShell
>>>> Font cannot be loaded! (Helvetica )
Error: attempt to add non-widget child “dsm” to parent “dislin” which supports only widgets.
Solution:
In system folder, /usr/local/lib/,
create the symbolic link libdislin.11.dylib to libdislin.11.3.0.dylib
sudo ln -s {full path to dislin}/lib/libdislin.11.3.0.dylib /usr/local/lib/libdislin.11.dylib
Set the new link’s permissions to. rwx r-x r-x
sudo chmod 755 /usr/local/lib/libdislin.11.dylib
There are two versions in system folders of the same dynamic library libXt.6.dylib :
(a) /opt/X11/lib/libXt.6.dylib (699 kB)
(b) /opt/X11/lib/flat_namespace/libXt.6.dylib (718 kB)
Made a backup copy of version (a), then make MacOS use version (b)
sudo mv /opt/X11/lib/libXt.6.dylib /opt/X11/lib/libXt.6.dylib.org
sudo cp /opt/X11/lib/flat_namespace/libXt.6.dylib /opt/X11/lib/libXt.6.dylib