Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

VecsKrakjis

macrumors newbie
Original poster
Dec 25, 2005
1
0
need help with compiling sh* or bat* files on MAC, need advice which program i need to use to do that?

It need to look something like this..
So i need a software to compile something like this?
:::

javac -cp .;./../OUTPUT;./../OUTPUT/unrenamed.jar; ./../OUTPUT/sign/*.java ./../OUTPUT/*.java *.java
javac -cp .;./../BotClasses;./../OUTPUT;./../OUTPUT/unrenamed.jar;./LIB/; *.java
javac -cp ../LIB;.;./../BotClasses;./../OUTPUT;./../OUTPUT/unrenamed.jar; *.java
java -noverify -Xmx500m -cp .;./OUTPUT;./OUTPUT/unrenamed.jar;./BotClasses;./LIB; Bot %1

???????????
 

notjustjay

macrumors 603
Sep 19, 2003
6,056
167
Canada, eh?
Or more to the point, .sh files are shell scripts which don't need to be compiled into an executable file -- as a script they are simply interpreted, line by line, by the shell. A .bat file is a "batch" file which has roots in MS-DOS.

generik's instructions show you how to change permissions to allow the .sh file to be executable, and then how to actually run the script (note that in Unix you need to explicitly specify that the file you want is in the current directory, by using the "./" prefix on your filename... although slightly inconvenient, and easily circumventable, it is good practice for system security).

Hope that helps.
 

rockstar

macrumors newbie
Jan 7, 2006
3
0
sh and unix executable files

I am running OSX. I need to execute a unix executable file and then run a shell script.
I've copied the exec file "transform" and *.sh file into the directory in which I want to run it. Then from X11 I go to that directory and type ./transform but receive the error message:
tcsh: ./transform: Exec format error. Binary file not executable.

This file was created with a f90 compiler at work (unix) and then copied to my mac. do I need to recompile it? If so how do I do that on mac?

Then I need to run a shell script from within the same directory. Do I need to type /bin/sh *.sh ??

:eek: help needed, thanks.
 

cubist

macrumors 68020
Jul 4, 2002
2,075
0
Muncie, Indiana
You cannot expect a binary executable file "transform" from your work system to work on the Mac. This is because they probably have different types of CPUs.

If you were using Java .jar files, they would work.

Also, I don't think the Mac comes with f90, it might come with f77, you could possibly transfer the Fortran source to the Mac and recompile it.
 

csubear

macrumors 6502a
Aug 22, 2003
613
0
cubist said:
You cannot expect a binary executable file "transform" from your work system to work on the Mac. This is because they probably have different types of CPUs.

If you were using Java .jar files, they would work.

Also, I don't think the Mac comes with f90, it might come with f77, you could possibly transfer the Fortran source to the Mac and recompile it.


You could use fink to install g77. I don't think there is a free f90 complier for OS X.
 

rockstar

macrumors newbie
Jan 7, 2006
3
0
fortran compiler for Mac

Thank you for the helpful responses. Indeed I already had g77 and f77 but neither seem to compile the f90 file. Maybe this is obvious.

My command statement and error response was as follows:

[athena:~] rockhopp% g77 ~/Desktop/transfer.f90 -o ~/Desktop/transform
/usr/bin/ld: /Users/rockhopper/Desktop/transfer.f90 bad magic number (not a Mach-O file)
collect2: ld returned 1 exit status

Should I be doiong something different here? Alternatively, on Fink, there exists a g95, will this work as a compiler for an f90 program?

newbie
 

bousozoku

Moderator emeritus
Jun 25, 2002
15,716
1,889
Lard
rockstar said:
Thank you for the helpful responses. Indeed I already had g77 and f77 but neither seem to compile the f90 file. Maybe this is obvious.

My command statement and error response was as follows:

[athena:~] rockhopp% g77 ~/Desktop/transfer.f90 -o ~/Desktop/transform
/usr/bin/ld: /Users/rockhopper/Desktop/transfer.f90 bad magic number (not a Mach-O file)
collect2: ld returned 1 exit status

Should I be doiong something different here? Alternatively, on Fink, there exists a g95, will this work as a compiler for an f90 program?

newbie

It would seem that you don't have a compiler that was compiled for Mac OS X. Other than scripts and other interpreted code, you can't just pull code from another system and run it.
 

rockstar

macrumors newbie
Jan 7, 2006
3
0
Mac fortran compiler

Thank you for your response. It is my understanding that g77 and f77 and g95 are Fortran compilers for Mac. My question is: it is likely that g77/f77 won't compile an f90 file (is this correct?) because f90 is a more recent language, but will a g95 compile an f90 file?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.