Opened 12 years ago

Closed 12 years ago

#37207 closed defect (invalid)

bad include paths?

Reported by: jshanab@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version: 2.1.2
Keywords: Cc:
Port: boost

Description

I am a senior developer working for years in c/c++ on Linux and Windows; But I am a bit new to OSX. I started using macports to get libraries like boost and curl. I do not know if this is a OSX convention, Macports choice or the responsibility of the individual maintainer but the include paths are collapsed and that causes problems in their use. For example on most linux and windows pacakages the include path is .../boost_1_49/include/boost. This allows you to put the path up to the boost_1_49 in the project and still follow a good practice of specifying an include subdir directory. ie #include <curl/curl.h> or #include <boost/thread/thread.h>. This allows you to change the version of boost at the project level.

By collapsing the path to /usr/local/boost and dumping all the headers directly at that level, all the C source code must change between OS's or the project must include /usr/local/include for the boost project. The side effect is now you also change the meaning of all other includes! For example #include <curl/curl.h> Is now sensitive to system path or include order. Is this a Mac,Macports, or maintainer convention? is there a work around?

Change History (2)

comment:1 Changed 12 years ago by jshanab@…

I found my workaround. Switch to homebrew, it honors the paths correctly. This choice is the single biggest decision and needs to be communicated before people end up downloading a lot of ports.

comment:2 Changed 12 years ago by neverpanic (Clemens Lang)

Port: boost added
Resolution: invalid
Status: newclosed
Type: requestdefect

MacPorts does not install into /usr/local (unless you manually configured it to do so, and it'll give you a hard time if you try it) and especially not into /usr/local/boost. I assume whatever you are describing are not files installed by MacPorts and will thus close the ticket as invalid.

MacPorts sticks to the filesystem hierarchy standard and installs headers in $prefix/include, e.g. the boost headers would be in $prefix/include/boost (1). It is indeed not possible to use boost from MacPorts but ignore other include files in $prefix/include.

(1) See http://packages.macports.org/boost/boost-1.52.0_1+no_single+no_static+python27.darwin_12.x86_64.tbz2 to get a list of files installed by the boost port in MacPorts.

Note: See TracTickets for help on using tickets.