Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Mac OS X lion 10.7.4 problems #48

Open
vmagnin opened this Issue · 1 comment

2 participants

@vmagnin
Collaborator

Message received from A. Graziosi:

The following occurs on Mac OS X lion 10.7.4, Xcode 4.4.1, MacPorts + its packages (gcc47, gtk2 etc.), and gtk-fortran jerryd-gtk-fortran-fcfa718.

  1. Using src/test.sh to build example gives this warning:

    ...
    ../examples/hl_list1.f90
    ld: warning: PIE disabled. Absolute addressing (perhaps -mdynamic-no-pic) not allowed in code signed PIE, but used in anon from gtk-hl-tree.o. To fix this warning, don't compile with -mdynamic-no-pic or link with -Wl,-no_pie
    ...

the attached patch seems to fix the warning but perhaps there is a better way

2.
Still building the examples there is this error:

...
../examples/hl_list_renderers.f90:36.6:

use gdk_pixbuf_hl
1
Fatal Error: Can't open module file 'gdk_pixbuf_hl.mod' for reading at (1): No such file or directory

I think you know how to fix it

3.
I have tried to build a library file, .a, with some changes to src/test.sh:

...
echo ">>> Removing old files..."
rm -rf *.o
rm -rf *.a
rm -rf *.mod
rm -rf *.out

gtkversion="pkg-config --cflags --libs gtk+-2.0"

gtk_hl_obj="gtk-hl-misc.o gtk-hl-accelerator.o gtk-hl-button.o gtk-hl-combobox.o gtk-hl-container.o gtk-hl-entry.o gtk-hl-menu.o gtk-hl-progress.o gtk-hl-spin-slider.o gtk-hl-tree.o gtk-hl-chooser.o gtk-hl-dialog.o"

echo ">>> Compiling gtk libraries..."
# gtk3 only: "unix-print-auto.f90"
for file in "gdk-auto.f90" "glib-auto.f90" "gtk.f90" "atk-auto.f90" "cairo-auto.f90" "gdk-pixbuf-auto.f90" "pango-auto.f90" "gtk-sup.f90" "gtk-hl-misc.f90" "gtk-hl-accelerator.f90" "gtk-hl-button.f90" "gtk-hl-combobox.f90" "gtk-hl-container.f90" "gtk-hl-entry.f90" "gtk-hl-menu.f90" "gtk-hl-progress.f90" "gtk-hl-spin-slider.f90" "gtk-hl-tree.f90" "gtk-hl-chooser.f90" "gtk-hl-dialog.f90" "gtk-hl.f90" "gdkevents-auto2.f90" "gtk-draw-hl.f90" ; do
"${GFC}" -c $file $gtkversion
done

echo ">>> Building the library..."
ar rcs libGtkFortran.a gtk.o gtk-sup.o gtk-hl.o ${gtk_hl_obj} gtk-draw-hl.o
...

("ar ru" gives the same...) but I got this warning:

/opt/local/bin/ranlib: file libGtkFortran.a(gtk/hl.o) has no symbol

it looks harmless, indeed using libGtkFortran.a seems to work but avoid that warning would be better!

--- test.sh~    2012-08-13 18:43:52.000000000 +0200
+++ test.sh 2012-08-19 12:52:58.000000000 +0200
@@ -16,6 +16,20 @@
 rm ../examples/*.mod
 rm ../examples/*.out

+osname="`uname -s`"
+
+case "${osname}" in
+    "Darwin")
+   linkerflags="-Wl,-no_pie"
+   ;;
+    # "Linux")
+    #  linkerflags="???"   
+    #  ;;
+    * )
+   linkerflags=""
+   ;;
+esac
+
 gtkversion="`pkg-config --cflags --libs gtk+-2.0`"

 gtk_hl_obj="gtk-hl-misc.o gtk-hl-accelerator.o gtk-hl-button.o gtk-hl-combobox.o gtk-hl-container.o gtk-hl-entry.o gtk-hl-menu.o gtk-hl-progress.o gtk-hl-spin-slider.o gtk-hl-tree.o  gtk-hl-chooser.o gtk-hl-dialog.o"
@@ -29,9 +43,9 @@
 echo ">>> Compiling examples..."
 for i in ../examples/*.f90 ; do 
   echo $i
-  "${GFC}" gtk.o gtk-sup.o gtk-hl.o ${gtk_hl_obj} gtk-draw-hl.o $i $gtkversion -o $i.out
+  "${GFC}" "${linkerflags}" gtk.o gtk-sup.o gtk-hl.o ${gtk_hl_obj} gtk-draw-hl.o $i $gtkversion -o $i.out
 done
-"${GFC}" gtk.o ../examples/gtkbuilder2.f90 -o ../examples/gtkbuilder2.f90.out $gtkversion `pkg-config --cflags --libs gmodule-2.0`
+"${GFC}" "${linkerflags}" gtk.o ../examples/gtkbuilder2.f90 -o ../examples/gtkbuilder2.f90.out $gtkversion `pkg-config --cflags --libs gmodule-2.0`

 echo ">>> Running the examples..."
 cd ../examples/
@jtappin
Collaborator

I'm no MacOS expert, and I don't have access to an OSX system to check things. However my best guess is that the issues are with the scripts rather than the core code, and I've not really touched test.sh and friends (other than fixing gtk2 references in the gtk3 branch) as I generally use the cmake system.

Probably now that there is a "run all examples" tool for that system we don't really need the old scripts unless there are issues with cmake on any platforms. Since OSX is Unix-based, I think that cmake and pkg-config should both be available there. According to freedesktop.org, pkg-config should also work on Windows so I'll remove the if(UNIX) condition around it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.