Skip to content
This repository has been archived by the owner on Apr 15, 2020. It is now read-only.

Document Boost::math oddities #1099

Merged
merged 4 commits into from
Oct 25, 2017
Merged

Document Boost::math oddities #1099

merged 4 commits into from
Oct 25, 2017

Conversation

OvermindDL1
Copy link
Contributor

Fixes #1098 but I'm not quite happy with how the restructuredtext is formatted, is that really becoming italic and why... Any ideas on how to fix that formatting?

@@ -42,7 +43,13 @@ List of components (other libraries are header-only):
- ``iostreams``
- ``locale``
- ``log``
- ``math``
- ``math`` - Requires Special names for ``find_package`` and ``target_link_libraries``, choose one of:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a list of components that can be used in hunter_add_package(Boost COMPONENTS ...) so it doesn't belong here. For the find_package(Boost CONFIG REQUIRED ...) you can add code snippet similar to Qt:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall make a new section for just math then, was trying not to expand it that far as it increases verbosity, but yeah it is probably required, shall do.

add_executable(foo foo.cpp)
target_link_libraries(foo Boost::math_tr1)

# Compatibility mode
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are testing it in other examples. Let's remove this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gladly. ^.^

hunter_add_package(Boost COMPONENTS math)

# now boost can be used
# you need to choose which form of Boost::math you want
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use all of them simultaneously?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can depending on t he functions you use. Technically you can link them all in and it will always work (relying on LTO to optimize them out).

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's link all of them. By this we will tests that all Boost::math_* targets are valid.

@ruslo
Copy link
Owner

ruslo commented Oct 20, 2017

I'm not quite happy with how the restructuredtext is formatted, is that really becoming italic and why... Any ideas on how to fix that formatting?

Actually it's bold for me, not italic. Are you talking about GitHub rendering or readthedocs (sphinx)? You can find documentation build instructions here:

@OvermindDL1
Copy link
Contributor Author

Actually it's bold for me, not italic. Are you talking about GitHub rendering or readthedocs (sphinx)? You can find documentation build instructions here:

Yeah the github renderer. I'm on an entirely terminal system here currently so I cannot see generated docs locally, I have to git push to github and check it, say, on my phone to see how it looks.

@ruslo
Copy link
Owner

ruslo commented Oct 23, 2017

Yeah the github renderer

They work differrently and will not look the same.

@OvermindDL1
Copy link
Contributor Author

They work differrently and will not look the same.

Ah, good to know that the restructured text format is so globally consistent... >.>

@OvermindDL1
Copy link
Contributor Author

What other changes are needed? I have time today to do so now. :-)

hunter_add_package(Boost COMPONENTS math)
find_package(Boost CONFIG REQUIRED math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
include_directories(${Boost_INCLUDE_DIRS})
target_link_libraries(... ${Boost_LIBRARIES})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Boost_LIBRARIES is a list of full paths, it's not recommended to use it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't CMake build's non-relocateable anyway? Plus ${Boost_INCLUDE_DIRS} would make it non-relocateable too?

# download boost
hunter_add_package(Boost COMPONENTS math)

# now boost::math can be used
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now boost::math -> now boost::math_* targets

-----------

When using Boost Math you will need to link in the libraries, however these are not named ``math`` but
rather are individual based on what you need to link it, the easist of which is to link in all parts:
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -89,6 +90,44 @@ For example:
- `boost.iostreams
options <http://www.boost.org/doc/libs/1_57_0/libs/iostreams/doc/index.html?path=7>`__

Boost::Math
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a little bit confusing. There is no imported library Boost::Math, C++ namespace is boost::. Let it be just Math then.


hunter_add_package(Boost COMPONENTS math)
find_package(Boost CONFIG REQUIRED math_c99 math_c99f math_c99l math_tr1 math_tr1f math_tr1l)
include_directories(${Boost_INCLUDE_DIRS})
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed

@OvermindDL1
Copy link
Contributor Author

Any other changes? :-)

@ruslo
Copy link
Owner

ruslo commented Oct 23, 2017

Testing with new math example:

@ruslo ruslo merged commit 0a492c7 into ruslo:master Oct 25, 2017
@ruslo
Copy link
Owner

ruslo commented Oct 25, 2017

I've removed OSX Boost.math testing (we have Visual Studio and Linux) because of the timeout, don't know what is the problem. My local test worked fine.

If you want to check it and add new toolchain take a look at this documents and open pull request:

Uploading:

@ruslo
Copy link
Owner

ruslo commented Oct 25, 2017

Released: https://github.com/ruslo/hunter/releases/tag/v0.19.134

ruslo pushed a commit to ingenue/hunter that referenced this pull request Oct 25, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Broken Package: Boost::math
2 participants