vishapoberon / compiler

vishap oberon compiler
http://oberon.vishap.am
GNU General Public License v3.0
186 stars 25 forks source link

cp: libVishapOberon.so: No such file or directory #2

Closed jkleiser closed 8 years ago

jkleiser commented 8 years ago

Doing 'make -f makefile.darwin.clang.x86_64' on my Mac-mini (OSX 10.10.5), seemed to work fine. However, installing gave this:

Mac-mini:voc jkleiser$ sudo make install
Password:
test -d "/opt"/voc-1.1/bin | mkdir -p "/opt"/voc-1.1/bin
cp voc "/opt"/voc-1.1/bin/
cp showdef "/opt"/voc-1.1/bin/
cp ocat "/opt"/voc-1.1/bin/
#cp vmake "/opt"/voc-1.1/bin/
cp -a src "/opt"/voc-1.1/
test -d "/opt"/voc-1.1/lib/voc | mkdir -p "/opt"/voc-1.1/lib/voc
test -d "/opt"/voc-1.1/lib/voc/ | mkdir -p "/opt"/voc-1.1/lib/voc
test -d "/opt"/voc-1.1/lib/voc/obj | mkdir -p "/opt"/voc-1.1/lib/voc/obj
test -d "/opt"/voc-1.1/lib/voc/sym | mkdir -p "/opt"/voc-1.1/lib/voc/sym
cp libVishapOberon.so "/opt"/voc-1.1/lib
cp: libVishapOberon.so: No such file or directory
make: *** [install] Error 1

When I then try to compile a simple module, I get this:

Mac-mini:voc jkleiser$ ./voc MyHelloWorld.Mod -M
 GNU x86_64 target
MyHelloWorld.Mod  translating MyHelloWorld  main program    327
MyHelloWorld.c:2:10: fatal error: 'SYSTEM.h' file not found
#include "SYSTEM.h"
         ^
1 error generated.

clang  MyHelloWorld.c /Users/noch/local/voc-1.1/lib/libVishapOberon.a  -o MyHelloWorld  -fPIC -g -I /Users/noch/local/voc-1.1/src/lib/system/darwin/clang/x86_64 -I /Users/noch/local/voc-1.1/lib/voc/obj  
clang: error: no such file or directory: '/Users/noch/local/voc-1.1/lib/libVishapOberon.a'
norayr commented 8 years ago

Hello, okay. Thank you for your courage to continue this. I am sure this is very good for a project.

I have written there my home directory - my user is noch. You can install it to your home directory or choose a different prefix.

Probablly I need to change the makefile, to have /opt as default installation prefix. I would also suggest to do

sudo make uninstall

to clean up your existing installation.

then "make" it again. (As far as I remember I was using "gmake", instead of "make" i. e. gnu make on osx, or that was with freebsd? Need to check).

For linking you should have "libtool" linker installed, as seen on line 33 in the makefile.


This makes me think that we don't have described proper exact requirements for OSX, and this has to be documented.

jkleiser commented 8 years ago

I have tried again with a fresh git clone and adjusted the makefile.darwin.clang.x86_64 so that line 24 is now like this:

PRF = "/Users/jkleiser/local"

However, the 'make -f makefile.darwin.clang.x86_64' still does not produces a libVishapOberon.so.

It seems I have the "libtool" linker installed:

Mac-mini:voc jkleiser$ which libtool
/usr/bin/libtool

See attached console output from make. make-log.txt

norayr commented 8 years ago

thank you for the log!
indeed, I forgot that on osx there are no .so shared objects, but .dylib libraries.

i believe you have libVishapOberon.dylib file.

ah, how I did not notice!

you have to do

make -f makefile.darwin.clang.x86_64 install.

because it has no mention of libVishapOberon.so,

and when you use "make install", it uses default "makefile" file which is for linux64 bit, and which has this libVishapOberon.so mentioned.

you can of course rename makefile.darwin.clang.x86_64 to makefile, if you'd like to type shorter commands.

otherwise you need to type

make -f makefile.darwin.clang.x86_64 install

hope this helps.

please do not hesitate to contact/ask further questions. i hope you'll confirm now that voc can be installed and used on your machine.

norayr commented 8 years ago

after installing, you need to type

/Users/jkleiser/local/voc/bin/voc

in order to invoke the compiler, or add /Users/jkleiser/local/voc/bin to your PATH environment variable.

jkleiser commented 8 years ago

Thanks. I'll do that.

jkleiser commented 8 years ago

I have now compiled and run my first code:

MODULE MyHelloWorld;

IMPORT
  SYSTEM, Args, Out := Console;

BEGIN
  Out.String("Hello, vishap world!");   Out.Ln;
END MyHelloWorld.

During compilation I got this:

Mac-mini:MyHelloWorld jkleiser$ voc MyHelloWorld.Mod -M
 GNU x86_64 target
MyHelloWorld.Mod  translating MyHelloWorld  main program    327
MyHelloWorld.c:12:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
export main(int argc, char **argv)
       ^
1 warning generated.

clang  MyHelloWorld.c /Users/jkleiser/local/voc-1.1/lib/libVishapOberon.a  -o MyHelloWorld  -fPIC -g -I /Users/jkleiser/local/voc-1.1/src/lib/system/darwin/clang/x86_64 -I /Users/jkleiser/local/voc-1.1/lib/voc/obj  
MyHelloWorld.c:12:8: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
export main(int argc, char **argv)
       ^
1 warning generated.

The final executable runs fine. Thanks!

norayr commented 8 years ago

amazing! (: