Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
17042 Discussions

How to set license file location for quartus_sh?

Altera_Forum
Honored Contributor II
5,557 Views

Hi there, 

 

We have been able to use bash scripts to compile our projects from Nios2EDS command line. Now I am trying to use Jenkins to streamline the project building process. 

 

Jenkins starts the bash shell directly from %quartus_root%\bin\cygwin\bin, but for some reason it doesn't invoke the bashrc coming with Nios2EDS installation. So I added source command in my script file to source the bashrc, which gets me to a point that it runs quartus_sh. 

 

This is when it complaints "License file is not specified". 

 

When I ran my script file from Nios2EDS command line, it works and doesn't complaint about license file. But from Jenkins it does.  

 

1. There must be a environment variable that has been set in Nios2EDS command line but missed when Jenkins directly launches bash shell. 

2. This variable is not initialized in bashrc file. 

 

I am stuck here. Could anyone shed some lights on how quartus_sh finds the license file? Maybe with that info I can tell the quartus_sh somehow in the Jenkins setup. 

 

Thanks! 

Hua
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
3,082 Views

Quartus->Tools->License setup 

 

Indicates that you can use the LM_LICENSE_FILE environment variable to point to the license location, though you do not need to set that for the GUI, since you can select the path to the license file. 

 

Try setting that variable. The command-line tools should be able to read it, so long as Jenkins inherits the environment correctly. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
3,082 Views

I have tried it but it didn't work. Jenkins does import environment variables from windows but my script is running in a bare bone bash shell that is not initialized by a bashrc. it won't have reference to what windows or Jenkins has defined.  

 

The nios2eds command line has no problem so it must somehow be initialized with the license info in a way other than LM_LISCENCE_FILE, maybe there is more in the initialization process of the bash shell than the bashrc file?
0 Kudos
Altera_Forum
Honored Contributor II
3,082 Views

 

--- Quote Start ---  

I have tried it but it didn't work. Jenkins does import environment variables from windows but my script is running in a bare bone bash shell that is not initialized by a bashrc. it won't have reference to what windows or Jenkins has defined.  

 

The nios2eds command line has no problem so it must somehow be initialized with the license info in a way other than LM_LISCENCE_FILE, maybe there is more in the initialization process of the bash shell than the bashrc file? 

--- Quote End ---  

 

 

When a new process is created in an operating system, it can inherit environment variables from the parent process. For example, when I run Cygwin, the shell will contain the variables I define as Windows environment variables, and then any 'extra' variables I define in a bashrc file, however, that bashrc file is optional. 

 

When you say "Jenkins" I assume you mean this tool: 

 

http://en.wikipedia.org/wiki/jenkins_%28software%29 

 

I've never used this tool, but it sounds like Java may be responsible for starting your bash process. Perhaps its not setting the environment properly. 

 

If you can print a message from your bash shell, create a Jenkins run that simply prints an environment variable. Try it under Linux and Windows and see if you get the same response. Try starting the Jenkins tool from the shell where you know the environment variable you are printing definitely exists. If the bash shell run from Jenkins can't see that variable, then its a problem with Jenkins. 

 

I'd recommending finding a forum where people know about Jenkins ... personally, this is the first time I've heard of it. 

 

Cheers, 

Dave
0 Kudos
Altera_Forum
Honored Contributor II
3,082 Views

Yes, that's the tool I was talking about. I am also a complete newbie for it so my understanding may be off. The tool is getting popular in embedded C or software development world, not so much with FPGA devs. 

 

The bat file we usually use to start the cygwin, it actually just make sure 3 environment variables are defined, and then launches bash.exe with a bashrc file to initialize the environment, including the paths. In my system I didn't have LM_LISCENSE_FILE defined, the bashrc file didn't check it neither, but somehow the quartus_sh doesn't complain about license file.  

 

Now the Jenkins also launches the bash.exe, with no way that I know of to invoke the bashrc file... even though I use source command to invoke it in my scripts (so I have all the paths and the bash won't complain about "command not found", but we have the license complaints.... will keep digging and report back
0 Kudos
Altera_Forum
Honored Contributor II
3,082 Views

Everything works now. Dave was right, LM_LISCENSE_FILE approach works. I must have forgotten to restart Jenkins service to refresh the environment variables. 

 

Thank again Dave!
0 Kudos
Altera_Forum
Honored Contributor II
3,082 Views

 

--- Quote Start ---  

Everything works now. ... Thank again Dave! 

--- Quote End ---  

 

 

Excellent! You're welcome. 

 

Cheers, 

Dave
0 Kudos
Reply