Author Topic: How can I install Code::Blocks on Linux without root access?  (Read 7537 times)

Offline minno

  • Single posting newcomer
  • *
  • Posts: 3
I've been following the wiki guide here, and I'm stuck on making wx.  I'm trying to install it on a computer where I don't have root access, so it fails when I try to use the command "make install", since it can't create the directory /opt/wx.  What do I have to change in the Makefile to be able to install it in my home directory instead?
« Last Edit: July 25, 2012, 11:36:36 pm by minno »

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How can I install Code::Blocks on Linux without root access?
« Reply #1 on: July 25, 2012, 10:04:37 pm »
For wx you don't need make install, just make is enough.
If you use the wx-config created in the root of the build-directory, it will work.

For C::B you can use the --prefix= parameter if you run configure, to chose the base-directory of your installation.

By the way, this should also work for wxwidgets, but as written before it's not necessarily needed.

Offline minno

  • Single posting newcomer
  • *
  • Posts: 3
Re: How can I install Code::Blocks on Linux without root access?
« Reply #2 on: July 25, 2012, 11:11:03 pm »
For wx you don't need make install, just make is enough.
If you use the wx-config created in the root of the build-directory, it will work.

For C::B you can use the --prefix= parameter if you run configure, to chose the base-directory of your installation.

By the way, this should also work for wxwidgets, but as written before it's not necessarily needed.

I don't have much experience with Linux.  So you're saying that in the part of the guide where it says to do: "../config --stuff" followed by "make", I don't need to do the next two steps, "su" and "make install"?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How can I install Code::Blocks on Linux without root access?
« Reply #3 on: July 25, 2012, 11:29:36 pm »
For wx you don't need make install, just make is enough.
If you use the wx-config created in the root of the build-directory, it will work.

For C::B you can use the --prefix= parameter if you run configure, to chose the base-directory of your installation.

By the way, this should also work for wxwidgets, but as written before it's not necessarily needed.

I don't have much experience with Linux.  So you're saying that in the part of the guide where it says to do: "../config --stuff" followed by "make", I don't need to do the next two steps, "su" and "make install"?
For wxWidgets : yes.
The only thing you need to do is call the wx-config in t the build-dir directly (with full or relative path) or add the path to it to your own PATH environment variable.

Offline minno

  • Single posting newcomer
  • *
  • Posts: 3
Re: How can I install Code::Blocks on Linux without root access?
« Reply #4 on: July 27, 2012, 07:48:14 am »
New problem:  I can't run the command "ldconfig" without root privileges.  Is there any workaround for this?  Is there a way that I can manually instruct the linker to look in the correct folders to find wx while I'm compiling codeblocks?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How can I install Code::Blocks on Linux without root access?
« Reply #5 on: July 27, 2012, 08:14:43 am »
New problem:  I can't run the command "ldconfig" without root privileges.  Is there any workaround for this?
I am not a Linux guy, but you can adopt the LD_LIBRARY path also via script file or shell startup-scripts. Have a look at the "run.sh" script that gets generated during the C::B build. Here, the LD_LIBRARY path is adopted so C::B finds its libraries (a.k.a. plugins). The same applies for wxWidgets or any other 3rd party lib, too IMHO.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How can I install Code::Blocks on Linux without root access?
« Reply #6 on: July 27, 2012, 11:20:48 am »
Normally you don't need to tweak ldconfig, automake and libtooll link and install fine, so C::B can be used without running ldconfig.
At least on all my linux boxes (Fedora, Debian, Mint, Uubuntu, CentOS).