DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 19th July 2008
roundkat roundkat is offline
Shell Scout
 
Join Date: May 2008
Posts: 107
Thanked 1 Time in 1 Post
Default Compiling from Source - tools needed ?

There are times when a certain package is available and it must be compiled from source..

I have been doing this a lot on Solaris 10 lately but that is another topic.

[OT]
I have a HOWTO or guide to installing Nagios w/ rrdtool , pnp4nagios on Solaris 10 that I am working on and will post later..
[/OT]

What is the recommended environment for compiling..
or are most of the requirements met with the default install..

much thx
rk
__________________
All posts sent on ReCycled Electrons...
Reply With Quote
  #2   (View Single Post)  
Old 19th July 2008
BSDfan666 BSDfan666 is offline
Real Name: N/A, this is the interweb.
Helpful companion
 
Join Date: Apr 2008
Location: Ontario, Canada
Posts: 2,223
Thanked 193 Times in 184 Posts
Default

Unfortunately, the answer isn't as simple as that.... there are many variables.
  • What language is the application you're compiling?
  • Do you have the appropriate dependencies installed?
  • Is it worth compiling manually, does a package/port exist...

First of all, did you install the comp43.tgz set, that includes the system binutils/gcc/headers/libraries etc.

Again, It's like walking into a large multicultural restaurant and asking *everybody* what you should order...
Reply With Quote
  #3   (View Single Post)  
Old 19th July 2008
TerryP's Avatar
TerryP TerryP is offline
Arp Constable
 
Join Date: May 2008
Location: USofA
Posts: 1,547
Thanked 112 Times in 104 Posts
Default

What you need depends on what you are building -> which should be outlined in the programs installation documentation if it is worth the bits it is stored in.


At the most basic level for C/C++ programs you need a suitable build environment. Usually a compiler, assembler, linker, make, and POSIX shell or DOS batch scripting environment.
__________________
My Journal

Thou shalt check the array bounds of all strings (indeed, all arrays), for surely where thou typest ``foo'' someone someday shall type ``supercalifragilisticexpialidocious''.
Reply With Quote
  #4   (View Single Post)  
Old 19th July 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by roundkat View Post
There are times when a certain package is available and it must be compiled from source..
I can only think of three possible reasons to compile ports instead of using packages:
  • A package is not available. The project does not have the resources to make packages available for all applications checked into the ports tree on all platforms supported.
  • For those running -current, -current packages sometimes may not always be in synchronization with snapshots or a system synchronized with the head of CVS. In fact, with snapshots builds being made every few days on some platforms, there is no way that the building of the entire ports tree can keep up. Synchronization issues are simply a reality. This can force -current users to resort to building applications themselves.
  • Customization and/or experimentation with building.
Quote:
What is the recommended environment for compiling..
or are most of the requirements met with the default install..
As long as the compXX.tgz file set has been installed, most ports can be built. There are two issues to consider here:
  • What are the dependencies required for building the port? These can differ from the dependencies required when running the port. The two make targets:
    • make print-build-depends
    • make print-run-depends
    ...can be real friends to those building applications. eg. X may be a requirement for building an application, but not required when running the application.
  • Likewise, how much disk space is available to /usr since this is where all third-party applications are installed, & specifically /usr/ports since this is where ports are built. Larger applications such as OpenOffice.org can take towards 20GB of space to build. Depending upon whether one cleans /usr/ports after each build (make clean=depends) or whether all object files, distribution files, & other meta-data needed during building are retained, more disk space may be required.
The importance of coordinating the version of the ports tree used with the version of the system installed cannot be overly stressed. Failure to do this can resort in a number of weirdnesses which are chronicled in Section 15.4.1 of the FAQ:

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

Lastly, there is rarely a need to locally build a port. OpenBSD users who are entertaining the thought of building their own ports should really, really be honest with themselves & take to heart the admonitions stated at the beginning of Section 15.1:

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

Last edited by ocicat; 19th July 2008 at 07:50 PM.
Reply With Quote
  #5   (View Single Post)  
Old 19th July 2008
roundkat roundkat is offline
Shell Scout
 
Join Date: May 2008
Posts: 107
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by BSDfan666 View Post
Unfortunately, the answer isn't as simple as that.... there are many variables.
  • What language is the application you're compiling?
  • Do you have the appropriate dependencies installed?
  • Is it worth compiling manually, does a package/port exist...

First of all, did you install the comp43.tgz set, that includes the system binutils/gcc/headers/libraries etc.

Again, It's like walking into a large multicultural restaurant and asking *everybody* what you should order...
BSDfan666

Good point.. ( I do get vague sometimes.. )

I should have specified the "C" environment..
I was basing my question off of my experience with Solaris 10.

My standard install for compiling is:
Quote:
-- coreutils-6.4
-- gcc-3.4.6
-- libtool-1.5.24
-- libiconv-1.11
-- make-3.81
-- zlib-1.2.3
granted there are other dependencies depending on the package..

I just got in my new drives and am in the process of replacing my Linux
email serve with OpenBSD and it looks like the Webmail package I want /need isn't available as a port or package..

I honestly had a good reason for asking this but .. oh crap.. getting old..
will remember later..
__________________
All posts sent on ReCycled Electrons...
Reply With Quote
  #6   (View Single Post)  
Old 19th July 2008
roundkat roundkat is offline
Shell Scout
 
Join Date: May 2008
Posts: 107
Thanked 1 Time in 1 Post
Default

Thx for all the responses.. WOW.. !

Ok.. my thoughts came back..

My question originated in a package that wasn't available in the OpenBSD ports tree or via package..

In the Solaris environment most of my dependencies I get from SunFreeware then
set up my compile environment and compile via make (as the installed make doesn't usually meet the requirements for newer packages.. )

ocicat .. much thanks the elaboration..
__________________
All posts sent on ReCycled Electrons...
Reply With Quote
  #7   (View Single Post)  
Old 19th July 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by roundkat View Post
My question originated in a package that wasn't available in the OpenBSD ports tree or via package..
Now you are potentially getting into the world of porting. The three main issues are:
  • Was the initial application written strictly in a POSIX compliant manner? If it was, then porting it to OpenBSD will be easier than if it was not. Nevertheless, are all supporting libraries available? In the case of Linux, not all libraries used by applications there will be the same as on OpenBSD or even available. You may be taking on the responsibility to emulate or fully port them yourself to OpenBSD in order for the application to run.
  • Likewise, what are the filesystem requirements? Note that OpenBSD's filesystem layout is different from that of other operating systems. Careful study of the hier(7) manpage may be required.
  • Was the application written as a 32-bit or 64-bit application? The answer to this question may resonate throughout the application & require many changes if you are moving it to a different processor.
You may need to study Section 9.4 of the FAQ for other foreign application support information:

http://openbsd.org/faq/faq9.html#Interact

...as well as the various compatibility manpages: compat_linux(8), compat_freebsd(8), compat_sunos(8), etc. There are other compat_* manpages you may need to read. Note that some of these compatibility layers may be limited and/or dated. As jggimi has noted elsewhere, maintenance of some of these emulation layers isn't quite as crucial today given that more natively compiled applications are increasingly available in the ports tree.

Lastly, porting can range for trivial to very complex. The better you understand the space where your target application lives, the easier your plight will be in porting it.

Last edited by ocicat; 19th July 2008 at 11:25 PM.
Reply With Quote
  #8   (View Single Post)  
Old 19th July 2008
ocicat ocicat is offline
Administrator
 
Join Date: Apr 2008
Posts: 2,888
Thanked 190 Times in 160 Posts
Default

Quote:
Originally Posted by roundkat View Post
My question originated in a package that wasn't available in the OpenBSD ports tree or via package..
You haven't stated what application you are considering, but you may be able to find an alternative already in the ports tree. The third-party site:

http://openports.se/

...is good for searching for similiar functionality.
Reply With Quote
  #9   (View Single Post)  
Old 19th July 2008
roundkat roundkat is offline
Shell Scout
 
Join Date: May 2008
Posts: 107
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by ocicat View Post
You haven't stated what application you are considering, but you may be able to find an alternative already in the ports tree. The third-party site:

http://openports.se/

...is good for searching for similar functionality.
ocicat

I am looking to add PNP4Nagios to my -current box..

It is running on 2 Solaris boxes (SPARC and x86) so I figured the next step would be to put it on
my OpenBSD box..

I do realize that the BSD environment is much different than Solaris which started all of this.. and
I should have stated pnp4nagios was what I was intending to compile and add to the existing
Nagios installation...

Will be more specific in the future..

Oh, my OpenBSD system is only 32 bit.

PNP4Nagios uses rrdtool which is in port /packages.

thx again...
rk
__________________
All posts sent on ReCycled Electrons...

Last edited by roundkat; 19th July 2008 at 06:57 PM.
Reply With Quote
Old 20th July 2008
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 3,711
Thanked 214 Times in 189 Posts
Default

When it comes to 3rd party applications that are not in the ports tree ...

There is a difference between "porting" them to OpenBSD and building an "OpenBSD port". The former means to install the application on an OpenBSD platform. The latter involves building the scaffolding to add the application to the ports tree: the port Makefile, OpenBSD specific patches, additional files, packing lists.

As Ocicat mentioned, sometimes porting is trivial, sometimes it's very complex. And it's also possible that someone has already gone through the trouble of porting the application, and perhaps afterwards built a port for the application, or, is working on it now.

I have no idea what it takes to port PNP4Nagios, nor to build a port for it. I did just check to see if the application had ever been mentioned on the ports@ mailing list. It had not been mentioned. If you have any trouble following build documentation or completing the installation ("porting") on OpenBSD, you could post to the ports@ mailing list and ask if anyone else has successfully installed it and could provide guidance ... or perhaps someone has built a port of it or has been working on a port.
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
Favorite Programming Tools JMJ_coder Programming 15 28th March 2012 01:40 PM
Quality and Backwards Compatibility of GNU Tools ... vermaden Off-Topic 1 12th May 2009 08:25 PM
UML tools bichumo Programming 2 12th September 2008 02:23 PM
MAC Tools Mentor / OTC Genesis stealintv Off-Topic 0 8th July 2008 12:55 AM
Benchmarking Tools JMJ_coder NetBSD General 8 16th June 2008 10:42 PM


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


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