bugGNU Octave - Bugs: bug #63901, [octave forge] (fem-fenics) In...

 
 

bug #63901: [octave forge] (fem-fenics) In assemble.cc there is an undeclared identifier 'mlock'

Submitter:  Marius Schamschula <mschamschula>
Submitted:  Thu 09 Mar 2023 06:57:56 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Build Failure
Status:  None Assigned to:  None
Originator Name:  mschamschula Open/Closed:  * Open
Release:  * other Operating System:  * Mac OS
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 11 Mar 2023 10:49:48 PM UTC, comment #4: 

The MacPorts octave PortGroup defaults to Sourceforge. On some more recent packages I override this by also specifying the GitHub PortGroup.

https://gnu-octave.github.io/packages/fem-fenics/ does indeed link to https://downloads.sourceforge.net/project/octave/Octave%20Forge%20Packages/Individual%20Package%20Releases/fem-fenics-0.0.5.tar.gz

Marius Schamschula <mschamschula>
Sat 11 Mar 2023 05:37:11 PM UTC, comment #3: 

Are you using the package sources from

https://sourceforge.net/p/octave/fem-fenics/ci/default/tree/

?  Is that really the latest version?

The attached diff (relative to the tip of the default branch of that repo) should help with the changes in the Octave API.  I noticed that some of these functions were deprecated in Octave 4.4, so it seems that no one has been maintaining this code recently.  Is that correct?

Also, I still see the following errors with my attempt at building, but those don't seem to be problems with the Octave API:


make
CPPFLAGS="-I. -fpermissive -DDOLFIN_VERSION=\"2019.2.0.dev0\" -DHAS_HDF5 -DHAS_SLEPC -DHAS_PETSC -DHAS_UMFPACK -DHAS_CHOLMOD -DHAS_SCOTCH -DHAS_ZLIB -DHAS_MPI -DDOLFIN_VERSION=2019.2.0.dev0 -I/usr/lib/petscdir/petsc3.18/x86_64-linux-gnu-real/include -I/usr/lib/slepcdir/slepc3.18/x86_64-linux-gnu-real/include -I/usr/lib/x86_64-linux-gnu/openmpi/include/openmpi -I/usr/lib/x86_64-linux-gnu/openmpi/include -I/usr/include/hdf5/openmpi -I/usr/include/eigen3 -I/usr/lib/python3/dist-packages/ffc/backends/ufc  -DLATEST_DOLFIN" /bin/mkoctfile -c Mesh.cc -o Mesh.o
Mesh.cc: In constructor ‘mesh::mesh(Array<double>&, Array<long int>&, Array<long int>&)’:
Mesh.cc:150:19: error: no matching function for call to ‘dolfin::MeshEditor::open(std::__shared_ptr_access<dolfin::Mesh, __gnu_cxx::_S_atomic, false, false>::element_type&, std::size_t&, std::size_t&)’
  150 |       editor.open (*msh, D, D);
      |       ~~~~~~~~~~~~^~~~~~~~~~~~
In file included from /usr/include/dolfin/mesh/dolfin_mesh.h:23,
                 from /usr/include/dolfin.h:10,
                 from mesh.h:21,
                 from Mesh.cc:19:
/usr/include/dolfin/mesh/MeshEditor.h:58:10: note: candidate: ‘void dolfin::MeshEditor::open(dolfin::Mesh&, dolfin::CellType::Type, std::size_t, std::size_t, std::size_t)’
   58 |     void open(Mesh& mesh, CellType::Type type, std::size_t tdim,
      |          ^~~~
/usr/include/dolfin/mesh/MeshEditor.h:58:10: note:   candidate expects 5 arguments, 3 provided
/usr/include/dolfin/mesh/MeshEditor.h:73:10: note: candidate: ‘void dolfin::MeshEditor::open(dolfin::Mesh&, std::string, std::size_t, std::size_t, std::size_t)’
   73 |     void open(Mesh& mesh, std::string type, std::size_t tdim,
      |          ^~~~
/usr/include/dolfin/mesh/MeshEditor.h:73:10: note:   candidate expects 5 arguments, 3 provided
Mesh.cc: In function ‘octave_value compute_facet_markers(std::shared_ptr<const dolfin::Mesh>, const Array<long int>&, std::size_t)’:
Mesh.cc:429:38: error: invalid initialization of reference of type ‘const std::vector<long unsigned int>&’ from expression of type ‘const std::vector<long int>’
  429 |     _msh->topology ().global_indices (0);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Mesh.cc:431:38: error: invalid initialization of reference of type ‘const std::vector<long unsigned int>&’ from expression of type ‘const std::vector<long int>’
  431 |     _msh->topology ().global_indices (D - 1);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
Mesh.cc: In function ‘octave_value compute_cell_markers(std::shared_ptr<const dolfin::Mesh>, const Array<long int>&, std::size_t)’:
Mesh.cc:529:38: error: invalid initialization of reference of type ‘const std::vector<long unsigned int>&’ from expression of type ‘const std::vector<long int>’
  529 |     _msh->topology ().global_indices (0);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
Mesh.cc:531:38: error: invalid initialization of reference of type ‘const std::vector<long unsigned int>&’ from expression of type ‘const std::vector<long int>’
  531 |     _msh->topology ().global_indices (D);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
make: *** [Makefile_common:31: Mesh.o] Error 1



(file #54472)

John W. Eaton <jwe>
Group administrator
Sat 11 Mar 2023 02:07:43 PM UTC, comment #2: 

Do you know how to do that alternative thing you propose?

Anonymous
Sat 11 Mar 2023 08:18:22 AM UTC, comment #1: 

One possible solution would be to modify the code to use an alternative memory locking mechanism that does not require special privileges.

PRIYANSHU SHUKLA <priyanshu>
Thu 09 Mar 2023 06:57:56 PM UTC, original submission:  

While building various packages against octave 8.1.0, I attempted to build the fem-fenics
package. I saw a possibly related bug in https://savannah.gnu.org/bugs/index.php?55175, as it also mentions the mlock issue. However, there are differences, particularly in this case the original error is the mlock rather than a missing cast.


/usr/bin/clang++ -c -I/opt/local/include -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -I. -pipe -Os -DNDEBUG -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -DDOLFIN_VERSION="2019.1.0" -DNDEBUG -DHAS_UMFPACK -DHAS_CHOLMOD -DHAS_ZLIB -DHAS_MPI -DDOLFIN_VERSION=2019.1.0 -I/opt/local/libexec/boost/1.76/include -I/opt/local/include/mpich-mp -I/opt/local/include/eigen3 -I/opt/local/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/ffc/backends/ufc -DLATEST_DOLFIN -fPIC -I/opt/local/include/octave-8.1.0/octave/.. -I/opt/local/include/octave-8.1.0/octave -I/opt/local/include  -pthread -pipe -Os -std=c++11 -stdlib=libc++ -isysroot/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk -arch arm64    assemble.cc -o assemble.o
In file included from assemble.cc:18:
In file included from ./form.h:23:
In file included from /opt/local/include/dolfin.h:14:
In file included from /opt/local/include/dolfin/graph/dolfin_graph.h:6:
In file included from /opt/local/include/dolfin/graph/Graph.h:28:
In file included from /opt/local/libexec/boost/1.76/include/boost/graph/adjacency_list.hpp:255:
In file included from /opt/local/libexec/boost/1.76/include/boost/graph/detail/adjacency_list.hpp:37:
In file included from /opt/local/libexec/boost/1.76/include/boost/graph/adjacency_iterator.hpp:13:
/opt/local/libexec/boost/1.76/include/boost/detail/iterator.hpp:13:1: warning: This header is deprecated. Use <iterator> instead. [-W#pragma-messages]
BOOST_HEADER_DEPRECATED("<iterator>")
^
/opt/local/libexec/boost/1.76/include/boost/config/header_deprecated.hpp:23:37: note: expanded from macro 'BOOST_HEADER_DEPRECATED'
# define BOOST_HEADER_DEPRECATED(a) BOOST_PRAGMA_MESSAGE("This header is deprecated. Use " a " instead.")
                                    ^
/opt/local/libexec/boost/1.76/include/boost/config/pragma_message.hpp:24:34: note: expanded from macro 'BOOST_PRAGMA_MESSAGE'
# define BOOST_PRAGMA_MESSAGE(x) _Pragma(BOOST_STRINGIZE(message(x)))
                                 ^
<scratch space>:36:2: note: expanded from here
 message("This header is deprecated. Use " "<iterator>" " instead.")
 ^
assemble.cc:57:7: error: use of undeclared identifier 'mlock'; did you mean 'clock'?
      mlock ();
      ^~~~~
      clock
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/time.h:109:9: note: 'clock' declared here
clock_t clock(void) __DARWIN_ALIAS(clock);
        ^
assemble.cc:64:7: error: use of undeclared identifier 'mlock'; did you mean 'clock'?
      mlock ();
      ^~~~~
      clock
/Library/Developer/CommandLineTools/SDKs/MacOSX12.sdk/usr/include/time.h:109:9: note: 'clock' declared here
clock_t clock(void) __DARWIN_ALIAS(clock);
        ^
assemble.cc:77:21: error: use of undeclared identifier 'error_state'
              if (! error_state)
                    ^
assemble.cc:166:21: error: use of undeclared identifier 'error_state'
              if (! error_state)
                    ^
1 warning and 4 errors generated.
make: *** [assemble.o] Error 1


Marius Schamschula <mschamschula>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #54472:  fem-fenics-diffs.txt added by jwe (29KiB - text/plain)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by priyanshu (Posted a comment)
  • -email is unavailable- added by mschamschula (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2023-03-11 jwe Attached File- Added fem-fenics-diffs.txt, #54472
        Summaryfem-fenics: In assemble.cc there is an undeclared identifier 'mlock' [octave forge] (fem-fenics) In assemble.cc there is an undeclared identifier 'mlock'

    Back to the top

    Powered by Savane 3.13-c54d.
    Corresponding source code