trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.21k stars 566 forks source link

Trilinos_INSTALL_INCLUDE_DIR installs includes into a build-dir path #10745

Closed yurivict closed 2 months ago

yurivict commented 2 years ago

I added the -DTrilinos_INSTALL_INCLUDE_DIR=include/trilinos argument. My build directory is /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build,

WIth -DTrilinos_INSTALL_INCLUDE_DIR=include/trilinos it installed files into build-dir:

-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_JacobianOperator.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_ComplexOperator.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_BorderedOperator.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_AbstractStrategy.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_LowerTriangularBlockElimination.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_UpperTriangularBlockElimination.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_Bordering.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_HouseholderQR.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSystem_AbstractGroup.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_Nested.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_BorderedSolver_Factory.H
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/wrkdirs/usr/ports/science/trilinos/work/.build/include/trilinos/LOCA_MultiContinuation_ExtendedVector.H

It should have installed them simply into include/trilinos.

csiefer2 commented 2 years ago

You really want to use an absolute path there, not a relative one

yurivict commented 2 years ago

Absolute path also failed:

-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Locks.cpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Locks.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_ReduceScan.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Half_Conversion.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Instance.cpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Instance.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_Cuda_Half_Impl_Type.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Cuda/Kokkos_CudaSpace.cpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/Kokkos_Core.hpp
-- Installing: /wrkdirs/usr/ports/science/trilinos/work/stage/usr/local//usr/local/include/trilinos/decl
yurivict commented 2 years ago

Supplying both relative and absolute paths should work, but now both don't work.

csiefer2 commented 2 years ago

I've never seen anyone install Trilinos using those options. This is what I use:

-D CMAKE_INSTALL_PREFIX=/my/directory

jjellio commented 2 years ago

I suspect you want -D CMAKE_INSTALL_PREFIX=/usr

yurivict commented 2 years ago

I just reran the build and observed the problem again.

-DCMAKE_INSTALL_PREFIX=/usr/local -DTrilinos_INSTALL_INCLUDE_DIR=include/trilinos Stage directory is /disk-samsung/freebsd-ports/science/trilinos/work/stage Source directory is /disk-samsung/freebsd-ports/science/trilinos/work/Trilinos-trilinos-release-13-4-0 Build directory is /disk-samsung/freebsd-ports/science/trilinos/work/.build

It installed these headers:

-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_LocalPermutationStrategy_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_LowPrecisionFactory_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MLParameterListInterpreter_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MapTransferFactory_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MatlabSmoother_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MatrixAnalysisFactory_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_Maxwell1_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MergedBlockedMatrixFactory_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MergedSmoother_fwd.hpp
-- Installing: /disk-samsung/freebsd-ports/science/trilinos/work/stage/disk-samsung/freebsd-ports/science/trilinos/work/.build/include/trilinos/MueLu_MultiVectorTransferFactory_fwd.hpp

As you can see - paths include the build directory which should never be the case.

This argument -DTrilinos_INSTALL_INCLUDE_DIR=include/trilinos is what triggered the problem. Trilinos installs okay without it.

bartlettroscoe commented 2 years ago

@yurivict, is this a bug? Why was I never @mentioned on this?

jjellio commented 2 years ago

@bartlettroscoe Not sure why you didn't get a mention. FYI, see https://github.com/trilinos/Trilinos/issues/10735 for a related issue that was closed.

I think they are trying to do a more standard "system" install (akin to autotools) - and so I pointed them towards the docs that let you override include/lib install locations - this could be a side effect of doing that

bartlettroscoe commented 2 years ago

Related to this is #10810 which I will be fixing shortly. That should make Trilinos installs behave correctly.

jhux2 commented 2 years ago

@bartlettroscoe Should there be a Tribits/cmake team on github?

bartlettroscoe commented 2 years ago

@bartlettroscoe Should there be a Tribits/cmake team on github?

@jhux2, sure, but it will just be me for the foreseeable future :-)

The @jwillenbring will need to add such team. I don't have the permissions to do it.

jhux2 commented 2 years ago

@trilinos/tribits

github-actions[bot] commented 1 year ago

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label. If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE. If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

yurivict commented 1 year ago

AFAIK there was no resolution of this.

jhux2 commented 1 year ago

@trilinos/framework

bartlettroscoe commented 1 year ago

@yurivict, I think the problem might be because for:

-DTrilinos_INSTALL_INCLUDE_DIR=include/trilinos

which is a CMake cache variable with type FILEPATH, it is treated by CMake (not Trilinos or TriBITS) as a relative path w.r.t. the current directory which is the build dir. See:

which states:

Furthermore, if the <type> is PATH or FILEPATH and the <value> provided on the command line is a relative path, then the set command will treat the path as relative to the current working directory and convert it to an absolute path.

And that substitution happens automatically by CMake (we don't have any control over this if we use the PATH or FILEPATH).

Can you please try passing in these relative paths as a STRING as:

-DTrilinos_INSTALL_INCLUDE_DIR:STRING=include/trilinos

and see if that fixes the problem?

Now, we could change the type for these path vars to be STRING but then a find-path dialog box does not come up in ccmake or the QT CMake GUI. I don't know of another solution other than to pass these in as STRING types for cases like this.

If that fixes your problem, I will update the documentation at:

to make it clear that you have to pass these paths as STRING if they are relative paths w.rt. the install dir. I will also add a TriBITS test to verify this behavior.

Please let me know if adding :STRING fixes the problem.


NOTE: This TriBITS/Trilinos documentation without the STRING type was written many years ago before CMake added the behavior described above with the FILE and FILEPATH types. This behavior is (not) shown in the documentation for the set() statement in CMake 2.8.1, for example, at:

which was the version of CMake for which this documentation was first written.

Bisecting the CMake documentation, it looks like CMake did not change that behavior until CMake 3.3 as shown by comparing:

and

I can't seem to find any CMake release note that documents this change in behavior.

github-actions[bot] commented 3 months ago

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label. If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE. If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

github-actions[bot] commented 2 months ago

This issue was closed due to inactivity for 395 days.