master-1.9, OSX and clang

15 views
Skip to first unread message

Jonathan Mason

unread,
Feb 27, 2013, 1:10:27 PM2/27/13
to maglev-d...@googlegroups.com
Hi all,

I've been harassing Tim about OpenSSL support since he's been working on it in master-1.9 anyway. So far it looks pretty good - Thanks Tim! - with a provision that I am using Ubuntu with gcc 4.7.2 my little OpenSSL Cipher encrypt/decrypt script runs as expected.

But our team at Versapay and most of the guys I saw when we visited Gemstone are using Macs. As you may or may not be aware Apple doesn't ship standard gcc anymore, as of I believe Xcode 4.2. I'm on OSX 10.7.5 with Xcode 4.6 and I've got llvm-gcc or clang, and I think clang is the default for 'CC'. 

So, my system seems to be defaulting to using clang to attempt to compile the OpenSSL extension which I think is hopeless. Theoretically but probably not practically, llvm-gcc should compile the same input as gcc 4.2, but I don't know how to make the MagLev loading attempt to compile with that instead of clang.

I observe the problem simply by checking out master-1.9, in this case I just completely blew away my GemStone install because it's dev and I don't care. Then I ran ./update.sh and tried to rake maglev:reload and it complains about being able to compile OpenSSL.

Tim added OPENSSL_DIR for me, because the OpenSSL I use is in /opt/local instead of the default OSX one, but in retrospect I think the default Mac OSX openssl should be fine, and I think this issue is because CC=clang and I have no idea how to change that.

Anyone else using a Mac around who knows more about MagLev's guts than me?

cheers,
Jon


jmason@jem-mbp: ~/development/maglev
$ rake1.9 maglev:start
Starting stone with netldi gs64ldi
GEMSTONE => /Users/jmason/development/maglev/gemstone
GEMSTONE_GLOBAL_DIR => /Users/jmason/development/maglev
=== Starting with netldiname gs64ldi
startstone[Info]: GemStone version '3.1.0.2'
startstone[Info]: Server 'maglev' is already running.

jmason@jem-mbp: ~/development/maglev
$ rake1.9 maglev:reload
=== Starting with netldiname gs64ldi
startstone[Info]: GemStone version '3.1.0.2'
startstone[Info]: Starting Stone repository monitor 'maglev'.
startstone[Info]: GEMSTONE is: '/Users/jmason/development/maglev/gemstone'.
startstone[Info]:
    GEMSTONE_SYS_CONF=/Users/jmason/development/maglev/etc/conf.d/maglev.conf
    GEMSTONE_EXE_CONF=/Users/jmason/development/maglev/maglev.conf
startstone[Info]: Log file is '/Users/jmason/development/maglev/log/maglev/maglev.log'.
startstone[Info]: GemStone server 'maglev' has been started, process 6547 .
Loading Kernel for maglev.  This may take a few seconds...
Compiling OpenSSL extension ...
        Compiling OpenSSL extension failed. Make sure you have OpenSSL headers installed.
        You can set the environment variable OPENSSL_DIR to point to the header directory.
a RubySystemExit occurred (error 2752)
topaz 1> exit

Adrian Madrid

unread,
Feb 27, 2013, 1:30:34 PM2/27/13
to maglev-d...@googlegroups.com
You might want to get gcc anyway: 


Makes things easier.

Adrian Madrid
aema...@gmail.com


--
You received this message because you are subscribed to the Google Groups "MagLev Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to maglev-discuss...@googlegroups.com.
To post to this group, send email to maglev-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/maglev-discussion?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jonathan Mason

unread,
Feb 27, 2013, 1:47:21 PM2/27/13
to MagLev Discussion
Appreciate the input, but I think I have "real" GCC 4.7.2 installed through macports as well. However, I don't know how to make MagLev want to use it over clang. Any thoughts on that part? Do you know if the OSX-GCC installer will set it up so GCC is my default compiler instead of clang?

Tim Felgentreff

unread,
Feb 27, 2013, 2:20:19 PM2/27/13
to MagLev Discussion
I won't get to it today, but @krono and I will look into it tomorrow

-Tim

From: Jonathan Mason
Sent: 27/02/2013 19:47
To: MagLev Discussion
Subject: Re: [maglev-discussion] master-1.9, OSX and clang

Jonathan Mason

unread,
Feb 27, 2013, 2:30:28 PM2/27/13
to MagLev Discussion
Hello,

For anyone interested in following along who's not in #maglev-ruby IRC.


I replaced my /usr/bin/cc and /usr/bin/gcc symlinks with ones that point at the macports gcc 4.7.2 and maglev:reload successfully compiles OpenSSL! So I'm making progress. 

That is not an ideal solution obviously, I'd like to be able to tell MagLev to use proper gcc without munging system files, but it moves me on for the moment.

Now I get an issue trying to run my crypt2 script. So we're back to "anyone else using master-1.9 on OSX" ? I'll investigate this issue more myself as well, but if anyone else has any thoughts.


$ maglev-ruby crypt2.rb
Warning: loadCLibrary dlopen failed, name: /Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle
   dlerror: dlopen(/Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle, 265): Symbol not found: _rb_Integer
  Referenced from: /Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle
  Expected in: flat namespace
 in /Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle
ERROR 2702 , a RubyLoadError occurred (error 2702), dlopen(/Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle, 265): Symbol not found: _rb_Integer
  Referenced from: /Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle
  Expected in: flat namespace
 in /Users/jmason/development/maglev/lib/ruby/1.9/openssl/ext/openssl.bundle (LoadError)
topaz 1> exit

Jonathan Mason

unread,
Feb 27, 2013, 2:32:16 PM2/27/13
to MagLev Discussion
Whoops, I missed half a thought in that last email. 

I was going to say, for anyone not following along on IRC, my crypt2.rb is here: https://gist.github.com/snarfmason/0eacf01123e29b9f1424
and thanks to Tim's work yesterday, it runs fine in my Ubuntu VM. Now I'm trying to get it going on OSX.

Tim Felgentreff

unread,
Feb 27, 2013, 5:07:45 PM2/27/13
to MagLev Discussion
We've seen this error on OS X before, something is odd with the symbol names - they all have an underscore in front, but there shouldn't be one. On Linux the shared object doesn't have those underscores and it works. We'll work out what's wrong there.

-Tim

From: Jonathan Mason
Sent: 27/02/2013 20:30
Reply all
Reply to author
Forward
0 new messages