DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD Packages and Ports

OpenBSD Packages and Ports Installation and upgrading of packages and ports on OpenBSD.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 26th August 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default pkg_add g95;g95 x.f95: cannot find g95

Hi all,

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.

Does anyone have any ideas as to what is going on?

uname -a:
OpenBSD te2100.nj 4.3 GENERIC#0 i386
Reply With Quote
  #2   (View Single Post)  
Old 26th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by enpey View Post
...and was able to use g95 to compile my code.
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:

http://www.openbsd101.com/updating.html#u4

...& Section 5 of the FAQ:

http://openbsd.org/faq/faq5.html

I would recommend that you stay with information provided officially by the project itself as opposed to relying on third party sites.

Last edited by ocicat; 26th August 2008 at 01:33 PM.
Reply With Quote
  #3   (View Single Post)  
Old 26th August 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

The local gcc is a modified version of gcc 3.3.5, they simply don't bump version counters.. it's inappropriate because it's not their project.

There is a man page documenting the changes to the compiler, most apparent are the stack protector changes..

It's a good read, gcc-local(1), I'm not sure, but I think the "gcc 4.2" port can coexist with the system compiler, one is in /usr and the other is in /usr/local.
Reply With Quote
  #4   (View Single Post)  
Old 26th August 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,052
Default

Quote:
Originally Posted by enpey View Post
H...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....
You will find 3rd party packages install within the /usr/local hierarchy. They should never install in /usr/bin.

To see where all of the files associated with g95 are, see the output of:

$ pkg_info -L g95
Reply With Quote
  #5   (View Single Post)  
Old 26th August 2008
enpey enpey is offline
Port Guard
 
Join Date: May 2008
Location: Newcastle, Australia
Posts: 33
Default

Ok, that is a fair point. I will follow official OpenBSD manuals.

I was looking in /usr/local/bin and /usr/bin.

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.
Reply With Quote
  #6   (View Single Post)  
Old 26th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by enpey View Post
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:

http://openbsd.org/faq/faq15.html

Likewise, you should familiarize yourself with how OpenBSD classifies its three flavors. This is covered in Section 5.1:

http://openbsd.org/faq/faq5.html#Flavors
Reply With Quote
  #7   (View Single Post)  
Old 26th August 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 3,319
Default

Quote:
Originally Posted by enpey View Post
When compiling I receive errors from gcc-4.2 about using strcpy(), sprintf() and strcat().
Most likely these were warnings. Compilation should be allowed to continue if these functions are used.
Quote:
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?
Basically, yes. gcc(1) as BSDfan666 mentioned earlier is modified to promote more secure practices, however it does not force code to be changed.
Reply With Quote
  #8   (View Single Post)  
Old 27th August 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Banned
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Default

The warning messages printed at compile time, are not a GCC modification, it's simply a frequently unused feature of the GNU linker.

Code:
#include <stdio.h>

__warn_references(printf, "Are you using printf????? Yay!!");

int
main(int argc, char **argv) {
	printf("This is a simplistic, unusual program.\n");
}
Results:
Code:
$ gcc example.c -o example
/tmp//ccw21238.o(.text+0x21): In function `main':
: Are you using printf????? Yay!!
$
The function is defined in <cdefs.h>, which is pulled in by <stdio.h>.
Reply With Quote
  #9   (View Single Post)  
Old 27th August 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 8,052
Default

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
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
pkg_add problems with connecting Mr-Biscuit NetBSD Package System (pkgsrc) 2 26th May 2009 11:44 AM
pkg_add - can't resolve <packagename> nihonto OpenBSD Packages and Ports 11 28th January 2009 10:03 PM
My version of pkg_add :) DNAeon FreeBSD Ports and Packages 26 15th October 2008 06:58 AM
pkg_add -r does not use exported packagesite kasse FreeBSD Ports and Packages 16 26th August 2008 08:42 PM
pkg_add error buba OpenBSD Packages and Ports 4 13th June 2008 03:29 PM


All times are GMT. The time now is 06:10 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick