How do I setup and run gfortran on Xcode 8 and Sierra - xcode8

I modified my old fortran code to run on my Mac. Not having an application to develop I left it alone for the last 2.5 years. Now I have an application that I want to write but find that I am generating some error messages. I assume that Xcode and Sierra have changed things enough that the gfortran I am trying to run is not configured correctly, or they just don't match.
I know Xcode was not written for fortran but some of my old code is in a project. I have no idea if was an attempt to use it as a development spot or just a holder for the code. Can someone point me in a direction that will get me going again. I am presently trying to use Terminal but without full success.

The best way to get your code running is to compile gfortran. It will work just fine with macOS Sierra - I have tested it in the past.
All you have to do is to go here:
https://gcc.gnu.org/wiki/GFortran
And compile the code. Simply download sources:
https://gcc.gnu.org/wiki/GFortranSource
> ./configure
> make
and that's it. You can also take a look here:
gfortran is not working on Mac OS X 10.9 (Mavericks)

Related

Debugging objc4 (532.2) on OS X 10.9

I'm trying to get objc4-532.2 to work on Mavericks.
(First of all, I tried to compile the latest version of objc4 (objc4-551.1).
This fails due os/lock_private.h is missing (objc-os.h). Maybe anyone knows how to solve this issue?)
Back to topic:
To successfully build objc4-532.2 I need to link against the frameworks which are based
on OS X 10.8.
So I configured the Xcode project to use OS X 10.8 SDKs for Base SDK and OS X Deployment Target.
This works, and I can compile and link a simple console based C program (Xcode template).
However when I try to link this program against Foundation and debug it, it miserably fails with the following error:
dyld: Symbol not found: _objc_debug_taggedpointer_mask Referenced from:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
Expected in:
/Users/manu/Library/Developer/Xcode/DerivedData/objc-dtrsexfveobodwdnwlpknyyiekpe/Build/Products/Debug/libobjc.A.dylib
in
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
The symbol _objc_debug_taggedpointer_mask was first introduced in objc4-551.1 (latest runtime) and all 10.9 Frameworks needs to access this symbol (at least in debug mode).
Example:
$ cd /System/Library/Frameworks/Foundation.framework/Versions/C
$ grep objc_debug_taggedpointer_mask Foundation
Binary file Foundation matches
A Framework based on 10.8 doesn't contain such a symbol.
Since my project is configured to use 10.8 SDKs this error should not occur?!
So, what's the missing point?
Thanks!
I solved this problem: the symbol of objc_debug_taggedpointer_mask was imported into runtime after mac os x 10.9, so you need to add the new tags into the 532.2's code to make it compatible with os x 10.9's foundation and other frameworks.
Here is my working directory:
https://github.com/Jeswang/objc4-532.2
(First of all, I tried to compile the latest version of objc4
(objc4-551.1). This fails due os/lock_private.h is missing
(objc-os.h). Maybe anyone knows how to solve this issue?)
The best solution I could find is to manually scrape together the header files as described here:
http://www.mulle-kybernetik.com/weblog/2011/how_to_build_libobjc_for_os_x.html
The closest thing to os/lock_private.h that I have found is private/tsd_private.h from the libpthread project:
https://opensource.apple.com/source/libpthread/libpthread-105.40.1/private/tsd_private.h
Edit
I have also found this:
https://github.com/samdmarshall/OSXPrivateSDK

Trying to install Xcode 3.2.6 on a Lion machine but it won't install correctly (Not Date issue)

So I have some Objective-c code that was created in Xcode 3.1 on OSX 10.5.8, and it will no run in Xcode 4. I used this handy little guide http://hints.macworld.com/article.php?story=20110318050811544 on one of my 10.7.4 box and it worked swimmingly. (I had just upgraded from 10.6).
So now I am trying to do the same, install 3.2, install 4, link SDKs etc on another machine running 10.7.3, and after using the little date hack with the same 3.2 mpkg that i used on the other computer, the installer says it finishes successfully but when I go to look, Xcode isn't installed anywhere, and the directory mentioned in the instructions linked above /Developers/SDKs doesn't even exist (it did on the other computer). I tried copying the 10.5 SDK from the 10.7.4 machine to the 10.7.3 machine and still nothing, 4 won't run it, and I get this error.
ld: cannot link directly with /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libcrypto.0.9.7.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
A little history too, the 10.7.4 machine had xcode 3 installed on it previous to it's update to lion so that was already there and I didn't have to mess with any of that nonsense. Is it something with having had it installed previous to the Lion upgrade?
So, how do I get Xcode 3 to work on the machine, and second does anyone recognize that error?
I think mean Xcode 4 does run, but can't build your project since that error message is from the linker at the last stage of building your project.
Here's a much easier way to install Xcode 3 on Lion: http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux
Make sure you install it to a different folder named other than Developer. Xcode 4 may go out of its way to find /Developer and remove it. I named mine /Xcode3.

Install mod_mono on Mac OSX

I just started to develop website with mono+asp.net mvc2 on mac osx but I am quite new to mono and mac.
I have got things working from MonoDevelop. My website is running ok with XSP when I run it from MonoDevelop.
Now, I am trying to test it from Apache server, but I don’t know how to set things up. Some instruction I can found are all very old or incomplete. I tried a few of them, but none worked.
Could anyone please help me out?
The best way to install mod_mono on OS X is from source. To do this there are a couple steps.
First, make sure you've installed XCode (which can be found on the DVD or the 2nd CD that came with the machine or the App Store) which will provide you with gcc and the rest of the standard toolchain.
Most of the normal in-between steps can be skipped, assuming you've already installed Mono and MonoDevelop from their stable release packages. If you encounter an error later on, you'll want to install updated versions of XSP and Mono and try again.
Next, download the latest stable release of mod_mono, extract the contents of the archive (by double clicking on the icon) and follow steps 1, 2 & 3 in the INSTALL file, and you should be good to go. This entire process took about ~5 minutes to get up and running :)
I am a novice with mono but followed some instructions. I downloaded and installed everything from here:
http://www.go-mono.com/mono-downloads/download.html
To get Apache to work with mod_mono.so I downloaded source from this page:
http://download.mono-project.com/sources/mod_mono/
You have to compile it. I went into the unpacked directory and wrote this in termminal:
./configure --prefix=/usr
make
sudo make install
This puts the mod_mono.so in correct Apache dir and the mod_mono.conf file. To include it you must add this to your httpd.conf (I put it at the end of the file):
# mod_mono_configuration
Include /etc/apache2/mod_mono.conf
MonoServerPath /Library/Frameworks/Mono.framework/Versions/Current/bin/mod-mono-server2

MonoDevelop -- GTK Designer just shows a blank square?

I am having problems getting the GTK designer to work with MonoDevelop. I tried 2.4 on Arch Linux and it gave this problem. Then I tried 2.2 on OpenBSD and it gives the exact same problem. Both machines are 64bit.
Instead of having a window to drag things on I just have a blank square:
alt text http://img96.imageshack.us/img96/4766/monodevelop.png
The tutorials I've seen look similar to this though:
alt text http://monodevelop.com/#api/deki/files/142/=Stetic_Tutorial_06.jpg?size=bestfit&width=700&height=425
So what gives? With my blank square I can't drag anything onto it, not a VBox or other container even. It will not react to anything.
Am I missing some sort of GTK# configuration or what? I find it highly improbable that both OSs' packages I tried are broken. Also, I've attached a (huge) bounty to this because this is a pretty big issue for me.
The console output from the starting of Mono and including me trying to drag an element onto the gray box is here
Update
Ok, so I've finally gotten a bit closer to solving the mystery. I use Fluxbox as my window manager usually. Well I tried using both KDE and Gnome-Session and both of them cause MonoDevelop to work properly(though still missing the window border, you could at least drag components onto it). Now my question is what makes Fluxbox not work for it?
I have the same problem in openSUSE 11.3 x64 KDE using Mono JIT compiler version 2.6.7 (tarball Wed Jul 14 18:00:23 UTC 2010) downloaded from here
type -a monodevelop returns:
monodevelop is /usr/bin/monodevelop
monodevelop is /usr/bin/X11/monodevelop
Running monodevelop from terminal gives the following output
1)
WARNING: Cannot find Mozilla directory
containing libgtkembedmoz.so. Some
Addins may not be able to function.
Please set MOZILLA_FIVE_HOME to your
Mozilla directory.
This can be solved by adding an environment variable in your .bashrc file from your home directory.
export MOZILLA_FIVE_HOME='/path/to/libgtkembedmoz.so/directory/'
To find if that library exists on your systems use:
sudo find / -name libgtkembedmoz.so
-print
(from this bug report this library is contain in the Mozilla's XUL Runner package, but in newer versions I don't know if it's still there, I had to use libgtkembedmoz.so provided by Slickedit which was installed in /opt/slickedit/bin/mozilla/)
2)
WARNING [2010-07-29 20:22:37Z]: Inotify watch limit is too low (8192).
To resolve this problem read Inotify Watches Limit
3)
WARNING [2010-07-29 20:22:37Z]: Error creating composed icon gtk-execute___asm0__debug-overlay-22.png__SmallToolbar at size SmallToolbar. Icon __asm0__debug-overlay-22.png__SmallToolbar is 22x22, expected 16x16.
I get the exact same error using Monodevelop 2.4, and I think this could be either from a broken GTK# installation or from a bug in Monodevelop,
Your result is the same as mine, see here. I suggest compiling MonoDevelop from Github and/or using a newer version of gtk-sharp/gdk-sharp
This part
ERROR [2010-07-29 20:22:37Z]: GdkPixbuf-Critical: gdk_pixbuf_composite: assertion `dest_x >= 0 && dest_x + dest_width <= dest->width' failed
appears in GTK and GDK crashes,
If this does not resolve the problem submitting a bug report is the next option. Although this is somehow strange, since I managed to complete the same tutorial using Kubuntu 10.04 LTS 64 bit a few weeks ago.
Uh, that is the designer. If the toolbox didn't show up, go to View->Pads->Toolbox to bring it up.
Note that this Gtk, you can't just drop a button or textbox on the design surface. You have to drop a container control first, and then can place buttons and such inside the container.
set global gtk theme to default
check all bindings depends
try start monodevelop from console and post output on pastebin
"Now my question is what makes Fluxbox not work for it? " remember the GTK protect was made for GNOME project, all the libraries are made to work on that Desktop. so need to see all the dependencies to run it property

Is there anyway to compile mac binaries from a windows machine?

Seems like there wouldn't be, but it would help us out if there was. I wish to pull the source down to a windows server and compile it and have it be the same as if I had pulled the source code down to a mac machine and used xcode on it. Any Ideas?
Reasons: Release Engineering and IT are much more familiar and comfortable on windows, so it would be easier on us, and LaunchD sucks.
Your original question had less detail... I think you are creating more problems than you are solving buy not using a Mac. Is it really that hard to learn to compile under Xcode or type make in the console?
Anyway...
Apple uses a modified version of the GCC C/C++/Objective C compiler with a proprietary runtime library... You could develop using a port of this code to Windows. See GNUStep.Org. This is not binary compatible though but it isn't impossible that you could rebuild it to cross compile to something that was Mac OS X compatible.
Another idea would be to develop using c# .NET and then move the binaries across to Mac OS X and run the binaries using Mono....
None of these options are robust enough to allow you to do this blind without a Macintosh to test and get up and running in the first place.
You can compile cross app with Cocotron but only on Mac
Why do you need launchd? cron works just as well on Mac as it does on Linux, just have a cronjob that does (Extremely simplified version ahead):
cd /my/source/dir
git pull # You are using Git, right?
xcodebuild MyCoolProject.xcodeproj
cp -r build/MyApp.app /the/distribution/folder