installing and using Macports

Discussion in 'Mac Programming' started by notwist, Mar 28, 2008.

  1. macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #1
    Is anyone familiar with Darwinports? I followed all the instructions here http://www.darwinports.com/install/ and everything seems fine. However, when I try installing a package from within Terminal like it says, there is no such file or directory. I am connected to the Internet so that's not the problem. What's wrong with this? I'm supposed to open a regular Terminal window and just type this correct?
     
  2. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #2
    Did you do the "export PATH=..." part on that link? They say to add it to the ~/.profile file but I think that should be ~/.bash_profile
     
  3. macrumors regular

    Joined:
    Dec 15, 2007
    #3
    ~/.profile works fine for me.

    post the results of

    Code:
    echo $PATH
     
  4. Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #4
    The reason I asked is because I've been using .bash_profile for a while and it works just fine. I guess I don't get the difference.
     
  5. thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #5
    This is what i get when i do echo $PATH

    /opt/local/bin:/opt/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/texbin
     
  6. macrumors regular

    Joined:
    Dec 15, 2007
    #6
    Your path is right so can you post the full error message.
     
  7. thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #7
    this is my error msg:

    Bluth:~ cjjacob$ cd /opt/local/bin/portslocation/dports/botan
    -bash: cd: /opt/local/bin/portslocation/dports/botan: No such file or directory
     
  8. macrumors regular

    Joined:
    Dec 15, 2007
    #8
    I've just installed it with changing directory since I don't have that directory either, all I had to run was

    Code:
    sudo port install botan
     
  9. thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #9
    Thanks! it worked however, when i try running one of the example codes, i get a whole bunch of errors saying it cannot find the botan/botan.h library. I ran the configure.pl script which is required but it isn't working. Here's where it's stuck:

    Bluth:~/downloads/botan-1.6.3 cjjacob$ ./configure.pl
    (autoconfig): Guessing your system config is gcc-darwin-i386
    (note): Enabling -fpermissive to work around possible GCC bug
    (autoconfig): Enabling module alloc_mmap
    (autoconfig): Enabling module es_egd
    (autoconfig): Enabling module es_ftw
    (autoconfig): Enabling module es_unix
    (autoconfig): Enabling module fd_unix
    (autoconfig): Enabling module ml_unix
    (autoconfig): Enabling module mp_ia32
    (autoconfig): Enabling module mux_pthr
    (autoconfig): Enabling module tm_unix
    Bluth:~/downloads/botan-1.6.3 cjjacob$ make
    g++ -Ibuild/include -O2 -finline-functions -mcpu=i686 -momit-leaf-frame-pointer -D_REENTRANT -ansi -Wno-long-long -fpermissive -W -Wall -fPIC -c src/adler32.cpp -o build/lib/adler32.o
    cc1plus: error: invalid option 'cpu=i686'
    make: *** [build/lib/adler32.o] Error 1
    Bluth:~/downloads/botan-1.6.3 cjjacob$
     
  10. macrumors regular

    Joined:
    Dec 15, 2007
    #10
    I got the same error but the following worked

    Code:
    cd Botan-1.6.3
    ./configure.pl --modules=comp_bzip2,comp_zlib
    Edited Makefile and changed

    Code:
    MACH_OPT      = -mcpu=i686 -momit-leaf-frame-pointer
    to
    Code:
    MACH_OPT      = -momit-leaf-frame-pointer
    Code:
    cd doc/examples
    make
     
  11. thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #11
    Thanks! It worked but... there is still an error.

    Here is where it stops:
    Bluth:~/downloads/botan-1.6.3 cjjacob$ make install
    Installing Botan into /usr/local...
    mkdir: /usr/local/doc: Permission denied
    make: *** [install] Error 1

    i tried this but it doesn't work either

    Bluth:~/downloads/botan-1.6.3 cjjacob$ make OWNER=cjjacob install
    Installing Botan into /usr/local...
    mkdir: /usr/local/doc: Permission denied
    make: *** [install] Error 1
    Bluth:~/downloads/botan-1.6.3 cjjacob$

    I really appreciate your help with this !
     
  12. macrumors regular

    Joined:
    Dec 15, 2007
    #12
    You need to use sudo to install in some directories. So you'd run

    Code:
    sudo make install
    then enter your password.
     
  13. thread starter macrumors regular

    Joined:
    Dec 29, 2006
    Location:
    New Brunswick, NJ
    #13
    Ok so I'm still having some problems. I tried compiling and running some of the example code using g++ and it compiles with no errors but I don't know how to run it.

    Code:
    Bluth:~/desktop/test cjjacob$ g++ untitled.cpp
    /usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
    Botan::MAC_Filter::MAC_Filter(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::OctetString const&, unsigned int)
    Botan::get_cipher(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, Botan::OctetString const&, Botan::OctetString const&, Botan::Cipher_Dir)
    Botan::block_size_of(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::Base64_Decoder::Base64_Decoder(Botan::Decoder_Checking)
    Botan::Base64_Encoder::Base64_Encoder(bool, unsigned int, bool)
    Botan::max_keylength_of(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::have_block_cipher(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::LibraryInitializer::initialize(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::LibraryInitializer::deinitialize()
    Botan::Zlib_Decompression::Zlib_Decompression()
    Botan::S2K::change_salt(Botan::MemoryRegion<unsigned char> const&)
    Botan::S2K::set_iterations(unsigned int)
    Botan::Fork::Fork(Botan::Filter*, Botan::Filter*, Botan::Filter*, Botan::Filter*)
    Botan::Pipe::process_msg(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::Pipe::DEFAULT_MESSAGE
    Botan::Pipe::read_all_as_string(unsigned int)
    Botan::Pipe::end_msg()
    Botan::Pipe::read_all(unsigned int)
    Botan::Pipe::start_msg()
    Botan::Pipe::Pipe(Botan::Filter*, Botan::Filter*, Botan::Filter*, Botan::Filter*)
    Botan::Pipe::~Pipe()
    Botan::Chain::Chain(Botan::Filter*, Botan::Filter*, Botan::Filter*, Botan::Filter*)
    Botan::get_s2k(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
    Botan::operator>>(std::basic_istream<char, std::char_traits<char> >&, Botan::Pipe&)
    Botan::S2K::derive_key(unsigned int, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const
    collect2: ld returned 1 exit status
    Bluth:~/desktop/test cjjacob$ 
    
    I tried ./a.out and searched the documents included but it didn't mention anything about how to run a program. Can you provide some insight into this?

    I appreciate your help.
     
  14. macrumors newbie

    Joined:
    Jul 15, 2008
    #14
    getting terminal not to forget paths

    If you find you self having to enter export commands every time you use macports, here is a suggestion:

    If you don't have a .bash_profile you can just make one you self an put it in you home directory.

    for reference, these are the export commands you'll put in the file:

    export PATH=$PATH:/opt/local/bin
    export MANPATH=$MANPATH:/opt/local/share/man
    export INFOPATH=$INFOPATH:/opt/local/share/info

    Another thing that you might have to do is to make it executable.

    The command:

    chmod u+x .bash_profile

    will do that.

    For those who'd like to know a bit more about what they're doing, here is a link:

    http://cs.senecac.on.ca/~unx122/lectures/Lecture6.html
     

Share This Page