I have recently installed OpenBSD. After installing I used
pkg_add -v g95
and was able to use g95 to compile my code.

I have since added cvsup and downloaded the src code and rebuilt the kernel and world (Following openbsd101 guide). I encountered no errors in the upgrade process, however I am no longer able to use g95. I have run
pkg_delete g95;pkg_add -v g95
and it seems to install correctly but I cannnot run it. It is not installed in /usr/bin/g95 where I expected it to be.

I assume you rebuilt the kernel & userland with gcc 4.2 as opposed to using the default gcc 3.3.5.

OpenBSD is vetted & built with gcc 3.3.5 which is installed by the comp43.tgz file set. To date, I am not aware that building the system is fully sanctioned with version 4.2. Since all packages are built with version 3.3.5, Version differences would account for why you are no longer able to use version 4.2; both the code & layout of resulting binaries are different between 3.3.5 & 4.2.

Likewise, while I don't see any fundamental differences between the information provided at the following:

I ended up just restarting with a fresh OpenBSD install, pkg_added g95 and then I came up with what was probably the same problem I had just had.

It installs egfortran and i386-unknown-openbsd4.3- files/directories. I am assuming that the package has been updated in the last couple of days, which is why I am finding this difference. I will endeavour to read up on OpenBSD and the package system soon, but I have at least got a functioning compiler.

When compiling I receive errors from gcc-4.2 about using strcpy(), sprintf() and strcat(). Is this something to do with OpenBSD gcc (3.3.5) being modified to force all calls to the safer versions of the above functions, while gcc-4.2 is not?

Thanks for the assistance, sorry to ask questions that are no doubt covered in online manuals.

I am assuming that the package has been updated in the last couple of days, which is why I am finding this difference.

Packages targeting OpenBSD 4.3-release will not have changed from when 4.3-release was released April 1, 2008. It would be good for you to review information on the packages/ports system by reading Section 15 of the FAQ:

g95-4.2 has gcc-4.2 as a prereq -- in our terms, a "dependency". If you take a look at where gcc-4.2 is installed, and how it's named, using pkg_info(1) as above, you will see that gcc-4.2's main executable is /usr/local/bin/egcc. It is named egcc to avoid any confusion with the built-in gcc, cc, g++ ... executable components included in the comp*.tgz file set during install.

You will not use the 4.2 version of gcc to build any OS components or 3rd party ports unless you are both knowledgeable about the OpenBSD make system and jump through hoops to alter its operation. And then, you will eliminate security features included in OpenBSD's version of gcc which are not in gcc-4.2, assuming you get usable binary output ... which is unlikely.

Whatever problem you are having is not due to installing g95. My guess is that you have not taken sufficient time to read through FAQ 5 and FAQ 15 in sufficient detail.

Last edited by jggimi; 27th August 2008 at 12:56 AM.
Reason: clarity, typos