Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8182843
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T00:58:47+00:00 2026-06-07T00:58:47+00:00

I have Windows 7 OS. I have followed the instructions from the PETSc web

  • 0

I have Windows 7 OS.
I have followed the instructions from the PETSc web page; in the command prompt of VS 2005 I have opened cygwin and installed PETSc with the command:

./configure --with-cc='win32fe cl' --with-fc=0 --with-mpi=0 --download-f2cblaslapack

I tried to run the following example from the web page:

cd src/ksp/ksp/examples/tutorials

make ex2

the ex2.c is a c program code. I get the following error:

$ make ex2

makefile:18: /conf/variables: No such file or directory

makefile:19: /conf/rules: No such file or directory

makefile:1151: /conf/test: No such file or directory

make: *** No rule to make target `/conf/test'.  Stop.

What is causing this?

(and more importantly)
How do I fix it?

*edit: I could use a general answer as well, because at the moment I don’t really even know what to Google for and I don’t feel like just contacting PETSc support for everything.


I’ve decided to work on Ubuntu. So now, here s the deal. After installation I write:

gcc -I$PETSC_DIR/include -L$PETSC_DIR/$PETSC_ARCH/lib -libpetsc ex2

in command line. I get the erros massage:

/usr/bin/ld: cannot find -libpetsc
ex2: In function _start':
(.text+0x1bc4): multiple definition of
_start’
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
ex2: In function _fini':
(.fini+0x0): multiple definition of
_fini’
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
ex2:(.rodata+0x0): multiple definition of _IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
ex2: In function
__data_start’:
(.data+0x0): multiple definition of __data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
ex2: In function
__data_start’:
(.data+0x8): multiple definition of __dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.6/crtbegin.o:(.data+0x0): first defined here
ex2: In function
_init’:
(.init+0x0): multiple definition of `_init’
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
collect2: ld returned 1 exit status

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T00:58:48+00:00Added an answer on June 7, 2026 at 12:58 am

    As mentioned on the PETSc web page under section Encounter problems? for problem related to make you need to set PETSC_DIR and PETSC_ARCH printed by configure.

    What is causing this?:
    The makefile in src/ksp/ksp/examples/tutorials directory refers to PETSC_DIR to include the configuration files i.e.

    include ${PETSC_DIR}/conf/variables
    include ${PETSC_DIR}/conf/rules
    
    ...
    include ${PETSC_DIR}/conf/test
    

    Now as you are executing make as just make ex2 (as from the error it indicates that you have not set PETSC_DIR variable), ${PETSC_DIR} is empty thus make tries to include /conf/variables, /conf/rules & /conf/test files which are not present.

    How do I fix it?
    You have to run make as mentioned on the website as
    make PETSC_DIR=<dir_output_from_configure> PETSC_ARCH=<arch_output_from_configure> ex2
    Before that you need to build the source correctly. To clarify from what you have mentioned in the question ./configure ... does not install PETSc but only configures the source for building. You need to run make. When you run configure if it was successful, it will output the configuration details including PETSC_DIR and PETSC_ARCH. Sample output:

    ./configure --with-mpi=0
    ===============================================================================
                 Configuring PETSc to compile on your system                       
    ===============================================================================
    TESTING: alternateConfigureLibrary from PETSc.packages.petsc4py(config/PETSc/packages/petsc4py.py:65)                                                                   Compilers:
    ...
    ...
    PETSc:
      PETSC_ARCH: arch-linux2-c-debug
      PETSC_DIR: /XXXX/petsc-3.3-p1
      Clanguage: C
      Scalar type: real
      Precision: double
      shared libraries: disabled
      dynamic loading: disabled
      Memory alignment: 16
    xxx=========================================================================xxx
     Configure stage complete. Now build PETSc libraries with (cmake build):
       make PETSC_DIR=/XXXX/petsc-3.3-p1 PETSC_ARCH=arch-linux2-c-debug all
     or (experimental with python):
       PETSC_DIR=/XXXX/petsc-3.3-p1 PETSC_ARCH=arch-linux2-c-debug ./config/builder.py
    xxx=========================================================================xxx
    

    Then you have run make PETSC_DIR=/XXXX/petsc-3.3-p1 PETSC_ARCH=arch-linux2-c-debug all as mentioned in the output of configure. This will build the libraries. Now you should be able to build the example. (Please note that this was run on Linux, you should pretty much be able to do the same on cygwin)
    Side note: There does not seem to be any need to set PETSC_ARCH for building the example, you should be able to build with make PETSC_DIR=<dir_output_from_configure> ex2

    Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have followed the instructions here: http://help.github.com/win-set-up-git/ to set up git on my windows
I have followed the instructions here [MDC - Adding Extensions using the Windows Registry],
I have followed all the instructions here: http://www.tonyspencer.com/2003/10/22/curl-with-php-and-apache-on-windows/ to install & config apache get
I have followed the Accepted Answer's instructions from this post as regards creating a
I have followed this guide to install Solr in TomCat running on Windows Server
I have Windows XP, installed VirtualBox, and have now a centOS virtual machine. I
I am new to development. I followed step by step instructions from http://code.google.com/apis/maps/articles/flashmapinwpf.html to
I have followed the instructions at http://www.javacodegeeks.com/2011/01/advanced-smartgwt-tutorial-part-1.html and tried to create a simple screen
I have windows 7 (64-bit) and I am trying to configure opencv 2.2 for
I have followed the instructions in SSL with Self Hosted WCF Service . When

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.