Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with relocatability #250

Open
guilhermebodin opened this issue Mar 16, 2023 · 1 comment
Open

Problems with relocatability #250

guilhermebodin opened this issue Mar 16, 2023 · 1 comment

Comments

@guilhermebodin
Copy link

Hello,

I am trying to compile a project using MadNLP and PackageCompiler but it seems to have some relocatability problems. One colleague compiled in his machine a small example and the result was

This is MadNLP version v0.5.2, running with umfpack
Number of nonzeros in constraint Jacobian............:        0
Number of nonzeros in Lagrangian Hessian.............:        0
Total number of variables............................:        1
                     variables with only lower bounds:        1
                variables with lower and upper bounds:        0
                     variables with only upper bounds:        0
Total number of equality constraints.................:        0
Total number of inequality constraints...............:        0
        inequality constraints with only lower bounds:        0
   inequality constraints with lower and upper bounds:        0
        inequality constraints with only upper bounds:        0
iter    objective    inf_pr   inf_du lg(mu)  ||d||  lg(rg) alpha_du alpha_pr  ls
   0  4.0400000e+00 0.00e+00 0.00e+00  -1.0 0.00e+00    -  0.00e+00 0.00e+00   0
   1  4.0001504e+00 0.00e+00 1.50e-09  -3.8 3.98e-02    -  1.00e+00 1.00e+00h  1
   2  4.0000000e+00 0.00e+00 2.53e-14  -8.6 1.50e-04    -  1.00e+00 1.00e+00h  1
Number of Iterations....: 2
                                   (scaled)                 (unscaled)
Objective...............:   3.9999999625061298e+00    3.9999999625061298e+00
Dual infeasibility......:   2.5313084961453569e-14    2.5313084961453569e-14
Constraint violation....:   0.0000000000000000e+00    0.0000000000000000e+00
Complementarity.........:   2.5061299702145512e-09    2.5061299702145512e-09
Overall NLP error.......:   2.5061299702145512e-09    2.5061299702145512e-09
Number of objective function evaluations             = 3
Number of objective gradient evaluations             = 3
Number of constraint evaluations                     = 4
Number of constraint Jacobian evaluations            = 3
Number of Lagrangian Hessian evaluations             = 2
Total wall-clock secs in solver (w/o fun. eval./lin. alg.)  =  4.306
Total wall-clock secs in linear solver                      =  0.266
Total wall-clock secs in NLP function evaluations           =  0.000
Total wall-clock secs                                       =  4.573
EXIT: Optimal Solution Found.
The result is x = 3.9999999625061298

but in my machine gives the following error

PS C:\Users\guilhermebodin\Downloads\SimplePackageCompiled\bin> .\SimplePackage.exe
EXIT: Internal Error.
"C:\\Users\\louis.reumaux\\.julia\\packages\\MadNLP\\frGLf\\src\\..\\Project.toml": No such file

In this case, we are probably trying to read the Project.toml in runtime with some macro like @__DIR__ and it causes the error. This might be one possible issue.

@frapac
Copy link
Member

frapac commented Mar 16, 2023

Thank you for reporting this issue when using MadNLP with PackageCompiler. We haven't tested it yet, but this is also something in our todo-list.

Your guess is right, we are using @__DIR__ to read the Project.toml in order to infer the current version of MadNLP:
https://github.com/MadNLP/MadNLP.jl/blob/master/src/MadNLP.jl#L25

If that cause an issue with PackageCompiler, that should be fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants