LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-29-2006, 12:01 AM   #1
angandas
LQ Newbie
 
Registered: Oct 2005
Location: Minneapolis
Posts: 2

Rep: Reputation: 0
LD_ASSUME_KERNEL - How to swap between 2 values?


Hi All,

I have tried out all possible ways (kudos to google) to solve my problem but am unsuccessful at the end of the day. I seek your help.

I am running a C++ program which calls Matlab and HSpice (a circuit simulation program) through the 'system' commands inside the program. The versions are:
Linux : 2.6.15-26-386 (Ubuntu 6.06)
Matlab: 7.0.0 (R14)
C++ compiler: g++

Since I have a windows version of Hspice, I have installed 'wine' (version: 0.9.19) through the Synaptic Package manager. To test if it runs fine or not, when I run ($ wine hspice.exe) at the command prompt, it runs perfect.

Now, regarding Matlab, I need to do symbolic analysis. On getting errors, I saw that I need to change the variable LD_ASSUME_KERNEL ($ export LD_ASSUME_KERNEL=2.4.1) in the same shell where I invoke Matlab. Then Matlab runs fine. But when I run hspice again from the same shell (terminal), then it fails. Changing back to LD_ASSUME_KERNEL=2.6 makes hspice run smoothly (as before), but screws up matlab.

How do I switch between the two values of LD_ASSUME_KERNEL? I can do it manually on the command prompt before invoking the tools individually, but as you understand, I cannot do it (inside my program) while executing (the program has a loop calling matlab and hspice alternatively).

Two of the things I have tried are:

1) Inside my program,
system("export LD_ASSUME_KERNEL=2.6 && wine hspice.exe");........
system("export LD_ASSUME_KERNEL=2.4.1 && matlab);.......
2) Tried by doing the same thing in .alias file for the two commands.
In the .bash_aliases file,
alias command_1='export LD_ASSUME_KERNEL=2.6 && wine hspice.exe'
alias command_2='export LD_ASSUME_KERNEL=2.4.1 && matlab'
Inside the program,
system("command_1");....
system("command_2);.....

They were of no use. Might be one cannot change the LD_ASSUME_KERNEL in runtime.

I eagerly look forward to your help in this regard.

P.S. :
1) The error in 'wine hspice' with LD_ASSUME_KERNEL=2.4.1 was:
..."wine: Unhandled page fault on write access to"......
2) The error in 'matlab' with LD_ASSUME_KERNEL=2.6 was:
..."Unable to load mex file: $Matlab7/toolbox/symbolic/maplemex.mexglx".....

Thanks,
Angan

Last edited by angandas; 08-29-2006 at 12:03 AM.
 
Old 08-29-2006, 06:20 AM   #2
AdaHacker
Member
 
Registered: Oct 2001
Location: Brockport, NY
Distribution: Kubuntu
Posts: 384

Rep: Reputation: 32
You don't have to do it as two commands. Try this:
Code:
LD_ASSUME_KERNEL=2.6 wine hspice.exe
You could also try setting the environment variable directly using putenv() before calling the external program.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LD_ASSUME_KERNEL setting ptreves Linux - Newbie 2 08-28-2007 02:19 PM
How can I set LD_ASSUME_KERNEL under LFS? happy_maoron Linux From Scratch 1 11-02-2005 10:06 PM
Using LD_ASSUME_KERNEL - problems with glibc MG-Cloud Linux - Software 0 05-17-2004 10:41 PM
export LD_ASSUME_KERNEL=2.2.5?? ksoma Linux - Newbie 2 09-21-2003 04:06 PM
how to set LD_ASSUME_KERNEL=2.2.5 monib Linux - Newbie 1 09-23-2001 06:46 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:58 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration